mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
switch-to-configuration: Don't require /etc/NIXOS
Check /etc/os-release if /etc/NIXOS doesn't exist.
This commit is contained in:
parent
f13bd41384
commit
f9e2af1e8b
1 changed files with 4 additions and 1 deletions
|
@ -26,7 +26,10 @@ EOF
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
die "This is not a NixOS installation (/etc/NIXOS is missing)!\n" unless -f "/etc/NIXOS";
|
# This is a NixOS installation if it has /etc/NIXOS or a proper
|
||||||
|
# /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;
|
||||||
|
|
||||||
openlog("nixos", "", LOG_USER);
|
openlog("nixos", "", LOG_USER);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue