checks: add check for Determinate
This provides a more useful error message than the `/etc/nix/nix.conf` hash mismatch error that would otherwise occur.
This commit is contained in:
parent
fb2bc03f92
commit
03877755e9
1 changed files with 19 additions and 0 deletions
|
|
@ -31,6 +31,24 @@ let
|
|||
fi
|
||||
'';
|
||||
|
||||
determinate = ''
|
||||
if [[ -e /usr/local/bin/determinate-nixd ]]; then
|
||||
printf >&2 '\e[1;31merror: Determinate detected, aborting activation\e[0m\n'
|
||||
printf >&2 'Determinate uses its own daemon to manage the Nix installation that\n'
|
||||
printf >&2 'conflicts with nix-darwin’s native Nix management.\n'
|
||||
printf >&2 '\n'
|
||||
printf >&2 'To turn off nix-darwin’s management of the Nix installation, set:\n'
|
||||
printf >&2 '\n'
|
||||
printf >&2 ' nix.enable = false;\n'
|
||||
printf >&2 '\n'
|
||||
printf >&2 'This will allow you to use nix-darwin with Determinate. Some nix-darwin\n'
|
||||
printf >&2 'functionality that relies on managing the Nix installation, like the\n'
|
||||
printf >&2 '`nix.*` options to adjust Nix settings or configure a Linux builder,\n'
|
||||
printf >&2 'will be unavailable.\n'
|
||||
exit 2
|
||||
fi
|
||||
'';
|
||||
|
||||
preSequoiaBuildUsers = ''
|
||||
firstBuildUserID=$(dscl . -read /Users/_nixbld1 UniqueID | awk '{print $2}')
|
||||
if
|
||||
|
|
@ -257,6 +275,7 @@ in
|
|||
|
||||
system.checks.text = mkMerge [
|
||||
(mkIf cfg.verifyMacOSVersion macOSVersion)
|
||||
(mkIf config.nix.enable determinate)
|
||||
(mkIf cfg.verifyBuildUsers preSequoiaBuildUsers)
|
||||
(mkIf cfg.verifyBuildUsers buildGroupID)
|
||||
(mkIf config.nix.enable nixDaemon)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue