Skip to content

Conversation

@peterhoeg
Copy link
Member

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
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@peterhoeg peterhoeg requested a review from dasJ as a code owner March 8, 2022 13:18
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Mar 8, 2022
@peterhoeg
Copy link
Member Author

Looping in everyone who was involved in the referenced PR: @aanderse @davidak @andrevmatos

Copy link
Member

@dasJ dasJ left a 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

@peterhoeg
Copy link
Member Author

peterhoeg commented Mar 8, 2022 via email

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 8, 2022
# /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;
Copy link
Member

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?

Suggested change
-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;

@peterhoeg
Copy link
Member Author

peterhoeg commented Mar 9, 2022 via email

@peterhoeg peterhoeg changed the title nixos/activation: allowed quoted values in /etc/os-release nixos/activation: allow quoted values in /etc/os-release Mar 9, 2022
@andrevmatos
Copy link
Member

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 .text anyway

@peterhoeg peterhoeg merged commit d44916d into NixOS:master Mar 9, 2022
@peterhoeg peterhoeg deleted the f/activation branch March 9, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants