nixos-rebuild-ng: run upgrade_channels with sudo#424802
nixos-rebuild-ng: run upgrade_channels with sudo#424802thiagokokada merged 2 commits intoNixOS:masterfrom
Conversation
|
CC @name-snrl to testing. |
|
Works for me. But I'm not sure if this problem should be solved in this way. I see 3 possible solutions:
wdyt @thiagokokada ? |
Oh, no, it doesn't. I see, it only loops over /nix/var/nix/profiles/per-user/root/channels/ edit: another "oh". I thought /nix/var/nix/profiles/per-user/root/channels/ isn't world-readable, but it's just symlinks on /nix/store: > ls -la /nix/var/nix/profiles/per-user/root/channels
lrwxrwxrwx - root root 1 Jan 1970 nixos -> /nix/store/7wfpz53k2lsa62wg42dg54li0rzkjwrw-nixos/nixos
lrwxrwxrwx - root root 1 Jan 1970 manifest.nix -> /nix/store/2m8whkhdd2y2lgjkxkhvwz207b46bd0w-env-manifest.nixSo, yes, is it correct: in cases when nixos-rebuild is run without --sudo and not as root - it would look at /nix/var/nix/profiles/per-user/root/channels/, but updates user's channels |
|
@name-snrl Ok, I added a check for |
Let me expand this a little. I think the current channel upgrade code is messy and maybe it shouldn't exist, so I would like to actually do 2, but I also think deprecating this option will cause headaches for channel users, so 3 is probably the quickest solution, this is why I decided to implement it. |
|
Looks like a good change. Since flakes vs channels is a forever limbo discussion, I don't think there's a need to outright deprecate this feature just yet. This is definitely a good way to handle it without any weird silent behaviors. |
|
Successfully created backport PR for |
Fix #424749.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.