1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

checks: make oldBuildUsers check fail hard

Checking for the Sequoia stuff won’t work properly if a system is
still in this old state. Best to be loud about it to deal with any
straggler systems that haven’t yet dealt with this issue.
This commit is contained in:
Emily 2024-09-10 21:32:06 +01:00
parent 2af5f0fb9e
commit 9c60c95008

View file

@ -46,12 +46,17 @@ let
oldBuildUsers = '' oldBuildUsers = ''
if dscl . -list /Users | grep -q '^nixbld'; then 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 "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 "You can enable the following option to migrate to new style nixbld users" >&2
echo >&2 echo >&2
echo " nix.configureBuildUsers = true;" >&2 echo " nix.configureBuildUsers = true;" >&2
echo >&2 echo >&2
echo "or disable this check with" >&2
echo >&2
echo " system.checks.verifyBuildUsers = false;" >&2
echo >&2
exit 2
fi fi
''; '';
@ -260,7 +265,7 @@ in
system.checks.text = mkMerge [ system.checks.text = mkMerge [
darwinChanges darwinChanges
runLink runLink
oldBuildUsers (mkIf (cfg.verifyBuildUsers && !config.nix.configureBuildUsers) oldBuildUsers)
(mkIf cfg.verifyBuildUsers buildUsers) (mkIf cfg.verifyBuildUsers buildUsers)
(mkIf (!config.nix.useDaemon) singleUser) (mkIf (!config.nix.useDaemon) singleUser)
nixStore nixStore