{activation-scripts,activate-system}: check gcroots before linking
When `nix.enable` is off, we don’t necessarily have an active Nix installation, so there won’t necessarily be an active `/nix/var/nix/gcroots` directory to link things into. NixOS just skips this unconditionally when `nix.enable` is off, but that doesn’t work well with a context in which we usually expect `nix.enable` to be coupled with an unmanaged system installation of Nix.
This commit is contained in:
parent
cd445c5465
commit
731910af01
2 changed files with 6 additions and 2 deletions
|
|
@ -21,7 +21,9 @@
|
|||
ln -sfn $(cat ${config.system.profile}/systemConfig) /run/current-system
|
||||
|
||||
# Prevent the current configuration from being garbage-collected.
|
||||
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
||||
if [[ -d /nix/var/nix/gcroots ]]; then
|
||||
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
||||
fi
|
||||
|
||||
${config.system.activationScripts.etcChecks.text}
|
||||
${config.system.activationScripts.etc.text}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,9 @@ in
|
|||
ln -sfn "$(readlink -f "$systemConfig")" /run/current-system
|
||||
|
||||
# Prevent the current configuration from being garbage-collected.
|
||||
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
||||
if [[ -d /nix/var/nix/gcroots ]]; then
|
||||
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
|
||||
fi
|
||||
'';
|
||||
|
||||
# FIXME: activationScripts.checks should be system level
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue