fix macos homebrew and system activations

This commit is contained in:
Noah Masur
2022-06-19 15:27:52 -04:00
parent bd7290fe63
commit 7861f9ec3a
3 changed files with 28 additions and 5 deletions

View File

@ -1,10 +1,11 @@
{ ... }: {
{ config, ... }: {
homebrew = {
enable = true;
autoUpdate = false; # Don't update during rebuild
cleanup = "zap"; # Uninstall all programs not declared
taps = [
"homebrew/cask" # Required for casks
"homebrew/cask-drivers" # Used for Logitech G-Hub
];
brews = [
@ -17,9 +18,30 @@
"meetingbar" # Show meetings in menu bar
"gitify" # Git notifications in menu bar
"logitech-g-hub" # Mouse and keyboard management
"mimestream" # Gmail client
];
global.brewfile = true; # Run brew bundle from anywhere
global.nolock = true; # Don't save lockfile (since running from anywhere)
global.noLock = true; # Don't save lockfile (since running from anywhere)
};
home-manager.users.${config.user} = {
home.activation = {
# Always install homebrew if it doesn't exist
installHomeBrew =
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
if ! xcode-select --version 2>/dev/null; then
xcode-select --install
fi
if ! /usr/local/bin/brew --version 2>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
'';
};
};
}