mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
checks: add check to ensure Homebrew is installed
Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
This commit is contained in:
parent
839fd2a2b5
commit
67fbc7aa24
1 changed files with 15 additions and 0 deletions
|
@ -28,6 +28,7 @@ let
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
oldBuildUsers = ''
|
oldBuildUsers = ''
|
||||||
if dscl . -list /Users | grep -q '^nixbld'; then
|
if dscl . -list /Users | grep -q '^nixbld'; then
|
||||||
echo "[1;31merror: Detected old style nixbld users, aborting activation[0m" >&2
|
echo "[1;31merror: Detected old style nixbld users, aborting activation[0m" >&2
|
||||||
|
@ -283,6 +284,19 @@ let
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
homebrewInstalled = ''
|
||||||
|
if [[ ! -f ${escapeShellArg config.homebrew.brewPrefix}/brew ]]; then
|
||||||
|
echo "[1;31merror: Using the homebrew module requires homebrew installed, aborting activation[0m" >&2
|
||||||
|
echo "Homebrew doesn't seem to be installed. Please install homebrew separately." >&2
|
||||||
|
echo "You can install homebrew using the following command:" >&2
|
||||||
|
echo >&2
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' >&2
|
||||||
|
echo >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -331,6 +345,7 @@ in
|
||||||
nixInstaller
|
nixInstaller
|
||||||
(mkIf cfg.verifyNixPath nixPath)
|
(mkIf cfg.verifyNixPath nixPath)
|
||||||
oldSshAuthorizedKeysDirectory
|
oldSshAuthorizedKeysDirectory
|
||||||
|
(mkIf config.homebrew.enable homebrewInstalled)
|
||||||
];
|
];
|
||||||
|
|
||||||
system.activationScripts.checks.text = ''
|
system.activationScripts.checks.text = ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue