mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
{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.
(cherry picked from commit 731910af01
)
This commit is contained in:
parent
67d262f923
commit
d0f10e610f
2 changed files with 6 additions and 2 deletions
modules
|
@ -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}
|
||||
|
|
|
@ -109,7 +109,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
|
||||
|
||||
exit $_status
|
||||
'';
|
||||
|
|
Loading…
Add table
Reference in a new issue