1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

nix-daemon: check for nixbld group before activation

Fixes #9
This commit is contained in:
Daiderd Jordan 2017-02-19 13:30:26 +01:00
parent 9a65d60811
commit 74c27037e6
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 9 additions and 0 deletions

View file

@ -51,5 +51,13 @@ in
// { TMPDIR = "${cfg.tempDir}"; };
};
system.activationScripts.nix-daemon.text = mkIf cfg.enable ''
buildUser=$(dscl . -read /Groups/nixbld 2>&1 | awk '/^GroupMembership: / {print $2}')
if [ -z $buildUser ]; then
echo "Using the nix-daemon requires build users, aborting activation" >&2
exit 2
fi
'';
};
}

View file

@ -59,6 +59,7 @@ in
# Prevent the current configuration from being garbage-collected.
ln -sfn /run/current-system /nix/var/nix/gcroots/current-system
${cfg.activationScripts.nix-daemon.text}
${cfg.activationScripts.nix.text}
${cfg.activationScripts.etc.text}