mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 18:57:08 +00:00
nix-gc: add check for nix.gc.automatic
This hopefully avoids problems for people that try to enable the service with a single-user install. Fixes #118
This commit is contained in:
parent
f5116b0f4d
commit
72b3648fa0
1 changed files with 12 additions and 0 deletions
|
@ -134,6 +134,17 @@ let
|
|||
exit 2
|
||||
fi
|
||||
'';
|
||||
|
||||
nixGarbageCollector = optionalString config.nix.gc.automatic ''
|
||||
if test -O /nix/store; then
|
||||
echo "[1;31merror: A single-user install can't run gc as root, aborting activation[0m" >&2
|
||||
echo "Configure the garbage collector to run as the current user:" >&2
|
||||
echo >&2
|
||||
echo " nix.gc.user = \"$USER\";" >&2
|
||||
echo >&2
|
||||
exit 2
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -147,6 +158,7 @@ in
|
|||
${runLink}
|
||||
${buildUsers}
|
||||
${nixStore}
|
||||
${nixGarbageCollector}
|
||||
${nixChannels}
|
||||
${nixInstaller}
|
||||
${nixPath}
|
||||
|
|
Loading…
Add table
Reference in a new issue