-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
nixos-{rebuild; install}: rework logic; use system.nix
#389487
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
base: master
Are you sure you want to change the base?
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/pinning-nixos-with-npins/63721/3 |
Otherwise we'd run into trouble when a filename contained e.g. a space
previously flake and buildingFile variables were used to deduce which method to use this originally came to that because flake variable was used to check if script is building flake or module after introduction of buildingFile variable, some parts got messy, checking if building flake was with -z $flake, checking if building module was with -n $flake, and checking if building by attrset was with -n $buildingFile don't forget about $noFlake in that mess using single variable to check which build method to use between two is fine, but when more methods are added, in my opinion it's better to use associative array using it also allows us easily check if user didn't use arguments from different build methods at the same time
nixos-rebuild now detects by-attrset configurations differently. The configuration file of by-attrset format is now detected by system.nix filename instead of default.nix, but manual didn't reflect that.
Use similar mechanism to what nixos-rebuild uses to evaluate which configuration file, and format, to build
nixos-install now detects by-attrset configurations differently, and uses system.nix filename instead of default.nix
e8f4dba
to
53a47a1
Compare
I rebased onto current master, last time I forgot to remove old check that still used old $buildingAttribute variable |
It's probably too late for 25.05, but can we get things going so this PR can get into the next release? |
previously flake and buildingFile variables were used to deduce which method to use this originally came to that, because flake variable was used to check if script is building flake or module
after introduction of buildingFile variable, some parts got messy,
checking if building flake was with -z $flake, checking if building module was with -n $flake, and checking if building by attrset was with -n $buildingFile
using single variable to check which build method to use between two is fine, but when more methods are added, in my opinion it's better to use associative array
resolves issues pointed in #333788
issue for by-attrset build method quoted above is resolved in the following way:
nixos-system
entry in nix pathdefault.nix
and warn about itsystem.nix
supercedes #333788
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-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.