-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
nixos-rebuild: do not resolve flake path #153515
nixos-rebuild: do not resolve flake path #153515
Conversation
Tested |
BTW, this should be backported to |
CC @edolstra and @cole-h since they're the folks that introduced the lines that are being deleted on this PR. CC @colemickens @figsoda to help testing. |
The removed lines converted the flake path passed by the command line from `/some/path` to `git+file:///some/path`. This technically shouldn't cause any issues, however running `nixos-rebuild switch` inside a directory `/nix/store` will cause the switch to fail and leave a partially construct generation (see issue #144811 for details). By itself this shouldn't be too much of an issue, however thanks to another issue in `systemd-boot-builder.py` this can leave the system in a broken state for those using `boot.loader.systemd-boot` (AFAIK the default), where future `nixos-rebuild switch` will fail (see issue #93694 for details). The issue can be fixed by running `nix-env -p /nix/var/nix/profiles/system --delete-generations old`, however this makes newbies very confused and it is showing in our support threads in Matrix and Discourse (see https://discourse.nixos.org/t/need-help-on-failure-of-building-my-configuration/16842). Keep in mind this is a workaround. The actual issue seems to be in nix itself (see: NixOS/nix#5510). See also #150065 for an alternative fix that caused other issues. Kudos for @figsoda for figuring out this fix.
Was only used in the code removed in commit c274d04.
Also CC @TredwellGit to test if this cause issues with ZFS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes the issue for me
would like it see another review since the other workaround caused issue on zfs
CC @TredwellGit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works with the ZFS modules.
Going to merge them and leave during some time on |
Successfully created backport PR #153935 for |
Awesome work, I ran into this a couple of times but I was too lazy to debug it, glad to see it was fixed 🎉 |
Motivation for this change
The removed lines converted the flake path passed by the command line from
/some/path
togit+file:///some/path
.This technically shouldn't cause any issues, however running
nixos-rebuild switch
inside a directory/nix/store
will cause the switch to fail and leave a partially construct generation (see issue #144811 for details).By itself this shouldn't be too much of an issue, however thanks to another issue in
systemd-boot-builder.py
this can leave the system in a broken state for those usingboot.loader.systemd-boot
(AFAIK the default), where futurenixos-rebuild switch
will fail (see issue #93694 for details).The issue can be fixed by running
nix-env -p /nix/var/nix/profiles/system --delete-generations old
, however this makes newbies very confused and it is showing in our support threads in Matrix and Discourse (see https://discourse.nixos.org/t/need-help-on-failure-of-building-my-configuration/16842).Keep in mind this is a workaround. The actual issue seems to be in nix itself (see: NixOS/nix#5510).
See also #150065 for an alternative fix that caused other issues.
Kudos for @figsoda for figuring out this fix.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes