diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 0bd18d37..6d65574f 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -357,5 +357,13 @@ in fi ''; + system.activationScripts.nix-daemon.text = mkIf daemon.enable '' + buildUser=$(dscl . -read /Groups/nixbld 2>&1 | awk '/^GroupMembership: / {print $2}') || true + if [ -z $buildUser ]; then + echo "Using the nix-daemon requires build users, aborting activation" >&2 + exit 2 + fi + ''; + }; } diff --git a/modules/services/nix-daemon.nix b/modules/services/nix-daemon.nix index 73df691a..39735c0d 100644 --- a/modules/services/nix-daemon.nix +++ b/modules/services/nix-daemon.nix @@ -51,13 +51,5 @@ in // { TMPDIR = "${cfg.tempDir}"; }; }; - system.activationScripts.nix-daemon.text = '' - buildUser=$(dscl . -read /Groups/nixbld 2>&1 | awk '/^GroupMembership: / {print $2}') || true - if [ -z $buildUser ]; then - echo "Using the nix-daemon requires build users, aborting activation" >&2 - exit 2 - fi - ''; - }; }