1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

Merge pull request #304 from aaschmid/configurable.brew.path

homebrew: make brew path configurable
This commit is contained in:
Daiderd Jordan 2021-05-26 22:20:22 +02:00 committed by GitHub
commit 007d700e64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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