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

@ -7,6 +7,7 @@
./utilities.nix
./hammerspoon.nix
./alacritty.nix
./homebrew.nix
];
options = with lib; {

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
'';
};
};
}

View File

@ -1,5 +1,5 @@
{ ... }: {
services.nix-daemon.enable = true;
system = {
@ -112,7 +112,7 @@
};
# Settings that don't have an option in nix-darwin
activationScripts.otherSettings.text = ''
activationScripts.postActivation.text = ''
echo "Disable disk image verification"
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
@ -129,7 +129,7 @@
defaults write com.apple.screensaver askForPasswordDelay -int 0
echo "Show the ~/Library folder"
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
chflags nohidden ~/Library
echo "Enable dock magnification"
defaults write com.apple.dock magnification -bool true