diff --git a/modules/system/checks.nix b/modules/system/checks.nix index 1cfe1c8d..f2971c47 100644 --- a/modules/system/checks.nix +++ b/modules/system/checks.nix @@ -46,12 +46,17 @@ let oldBuildUsers = '' if dscl . -list /Users | grep -q '^nixbld'; then - echo "warning: Detected old style nixbld users" >&2 + echo "error: Detected old style nixbld users, aborting activation" >&2 echo "These can cause migration problems when upgrading to certain macOS versions" >&2 echo "You can enable the following option to migrate to new style nixbld users" >&2 echo >&2 echo " nix.configureBuildUsers = true;" >&2 echo >&2 + echo "or disable this check with" >&2 + echo >&2 + echo " system.checks.verifyBuildUsers = false;" >&2 + echo >&2 + exit 2 fi ''; @@ -260,7 +265,7 @@ in system.checks.text = mkMerge [ darwinChanges runLink - oldBuildUsers + (mkIf (cfg.verifyBuildUsers && !config.nix.configureBuildUsers) oldBuildUsers) (mkIf cfg.verifyBuildUsers buildUsers) (mkIf (!config.nix.useDaemon) singleUser) nixStore