Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmupdate: add support for nixos #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

vmupdate: add support for nixos #168

wants to merge 1 commit into from

Conversation

evq
Copy link

@evq evq commented Sep 19, 2024

this PR adds support for nixos updates based on the discussion in QubesOS/qubes-issues#7992.

thanks for all the quick replies and advice @marmarek

notes:

  • this uses a qubes specific wrapper script in order to allow for end user customization of the nixos-rebuild flags via the qubes update nix module. the possibility was mentioned that reading flags from a file might be preferred - however it seemed tidier this way and we can instead have the wrapper simply pass it's arguments on to nixos-rebuild.
  • it also uses a qubes specific wrapper to retrieve currently installed packages. of the options available for listing installed package versions, nix store diff-closures seemed to be the best option however it is designed to diff. e.g. compare the previous system closure to the previous ones. the wrapper script first constructs an empty closure so that we can diff against it. again, it seemed tidier to abstract these details away.

@evq
Copy link
Author

evq commented Sep 19, 2024

will resign this with gpg later

@@ -276,7 +276,10 @@ def upgrade_internal(self, remove_obsolete: bool) -> ProcessResult:
Just run upgrade via CLI.
"""
cmd = [self.package_manager,
"--noconfirm" if self.package_manager == "pacman" else "-y",
*(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just extended the existing pattern but please let me know if you'd prefer I clean this up in some way. as-is package manager specifics are leaking into this common module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already fixed in #164, but it waits for resolving conflicts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the other PR is merged now, you can rebase to resolve the conflict.

Comment on lines 228 to +232
result.out += self._print_to_string(
pkg,
str(changes["updated"][pkg]["old"])[2:-2]
", ".join((changes["updated"][pkg]["old"]))
+ " -> " +
str(changes["updated"][pkg]["new"])[2:-2])
", ".join((changes["updated"][pkg]["new"]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a syntax error: not closed (

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants