-
-
Notifications
You must be signed in to change notification settings - Fork 17.3k
nixos/activation: allow quoted values in /etc/os-release #163320
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
Conversation
|
Looping in everyone who was involved in the referenced PR: @aanderse @davidak @andrevmatos |
dasJ
left a comment
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.
If there's no strong opinions against merging this I'll do so today or tomorrow since the fix feels important
|
It's not super urgent, as a NixOS installation would have /etc/NIXOS so this check would only be hit in that if missing.
|
| # /etc/os-release. | ||
| die "This is not a NixOS installation!\n" unless | ||
| -f "/etc/NIXOS" || (read_file("/etc/os-release", err_mode => 'quiet') // "") =~ /ID=nixos/s; | ||
| -f "/etc/NIXOS" || (read_file("/etc/os-release", err_mode => 'quiet') // "") =~ /ID="?nixos"?/s; |
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.
Maybe we could broaden the NIXOS check?
| -f "/etc/NIXOS" || (read_file("/etc/os-release", err_mode => 'quiet') // "") =~ /ID="?nixos"?/s; | |
| -e "/etc/NIXOS" || (read_file("/etc/os-release", err_mode => 'quiet') // "") =~ /ID="?nixos"?/s; |
|
I understand you have it symlinked to /dev/null and it therefore fails the -f check (presumable -d would work in your case), but what is the actual *reason* for supporting something that points to either a !file or a missing file?
|
|
No strong reasons, just thought that a verification check could always be widened if it doesn't break anything, but no problem if it's not changed, already updated my installation to |
Description of changes
After #162168 was merged, the value of the ID key in /etc/os-release is now quoted, so change our activation check to also allow quoted values.
Things done
sandbox = trueset 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.shto update generated release notes