1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

homebrew: make brew path configurable

Signed-off-by: Andreas Schmid <service@aaschmid.de>
This commit is contained in:
Andreas Schmid 2021-03-06 13:12:19 +01:00
parent 5c3146b75d
commit f6bec24aeb

View file

@ -52,6 +52,14 @@ in
'';
};
brewPrefix = mkOption {
type = types.str;
default = "/usr/local/bin";
description = ''
Customize path prefix where executable of <command>brew</command> is searched for.
'';
};
cleanup = mkOption {
type = types.enum [ "none" "uninstall" "zap" ];
default = "none";
@ -204,8 +212,8 @@ in
system.activationScripts.homebrew.text = mkIf cfg.enable ''
# Homebrew Bundle
echo >&2 "Homebrew bundle..."
if [ -f /usr/local/bin/brew ]; then
PATH=/usr/local/bin:$PATH ${brew-bundle-command}
if [ -f "${cfg.brewPrefix}/brew" ]; then
PATH="${cfg.brewPrefix}":$PATH ${brew-bundle-command}
else
echo -e "\e[1;31merror: Homebrew is not installed, skipping...\e[0m" >&2
fi