Nixpkgs version
Describe the bug
I was helping my friend install NixOS. I always use --sudo/--use-remote-sudo flag. I recommended that he use this flag as well, but when he tried to upgrade the system using a single command:
nixos-rebuild boot --sudo --upgrade
it didn’t work. In nixos-rebuild(-ng), the nix-channel --update is executed as the current user. However, I believe it should always be run as root, because the description of this option says:
Update the root user's channel named ‘nixos’ before rebuilding the system.
But it doesn't if nixos-rebuild(-ng) was run not from root, and --sudo/--use-remote-sudo doesn't nothing in such case.
But this doesn’t happen if nixos-rebuild(-ng) is not run as root, and in this case, --sudo/--use-remote-sudo flag doesn’t help either.
Steps to reproduce
install nixos, try to upgrade it using nixos-rebuild boot --sudo --upgrade
Expected behaviour
nix-channel --update is always run as root
Screenshots
No response
Relevant log output
Additional context
I'm not sure if this was discussed before, but I couldn't find an issue that directly describes it — only the first comment in #381814 mentions it
Notify maintainers
@thiagokokada @Mic92 @K900
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Nixpkgs version
Describe the bug
I was helping my friend install NixOS. I always use
--sudo/--use-remote-sudoflag. I recommended that he use this flag as well, but when he tried to upgrade the system using a single command:it didn’t work. In
nixos-rebuild(-ng), thenix-channel --updateis executed as the current user. However, I believe it should always be run as root, because the description of this option says:But it doesn't if nixos-rebuild(-ng) was run not from root, and
--sudo/--use-remote-sudodoesn't nothing in such case.But this doesn’t happen if
nixos-rebuild(-ng)is not run as root, and in this case,--sudo/--use-remote-sudoflag doesn’t help either.Steps to reproduce
install nixos, try to upgrade it using
nixos-rebuild boot --sudo --upgradeExpected behaviour
nix-channel --updateis always run as rootScreenshots
No response
Relevant log output
Additional context
I'm not sure if this was discussed before, but I couldn't find an issue that directly describes it — only the first comment in #381814 mentions it
Notify maintainers
@thiagokokada @Mic92 @K900
Note for maintainers: Please tag this issue in your pull request description. (i.e.
Resolves #ISSUE.)I assert that this issue is relevant for Nixpkgs
Is this issue important to you?
Add a 👍 reaction to issues you find important.