diff --git a/hosts/poppy/default.nix b/hosts/poppy/default.nix index 17e0f33..72d9191 100644 --- a/hosts/poppy/default.nix +++ b/hosts/poppy/default.nix @@ -1,200 +1,22 @@ { pkgs, ... }: { + imports = [ ./homebrew.nix ./system.nix ]; + networking.hostName = "poppy"; - - # Allow unfree packages (some macOS-ported tools need it) - nixpkgs.config.allowUnfree = true; - system.primaryUser = "michaotic"; + system.stateVersion = 7; - # nix settings - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; + nixpkgs.config.allowUnfree = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; users.users.michaotic = { home = "/Users/michaotic"; shell = pkgs.zsh; }; - environment.systemPackages = [ - pkgs.vim - ]; + environment.systemPackages = [ pkgs.vim ]; - # Homebrew - CRITICAL: cleanup = "zap" means unused casks get removed! - homebrew.enable = true; - homebrew.onActivation.cleanup = "zap"; - - homebrew.taps = [ - "tw93/tap" - "typewhisper/tap" - ]; - - homebrew.brews = [ - "kew" - "mole" - ]; - - homebrew.casks = [ - "google-chrome" - "google-drive" - "krishkrosh/apps/trackweight" - "bitwarden" - "marta" - "vscodium" - "github" - "docker-desktop" - "ollama-app" - "opencode-desktop" - "microsoft-word" - "microsoft-excel" - "microsoft-powerpoint" - "obsidian" - "anki" - "calibre" - "telegram" - "maccy" - "mos" - "caffeine" - "typewhisper/tap/typewhisper" - "lunacy" - "skim" - ]; - - # System defaults - system.defaults = { - NSGlobalDomain.AppleInterfaceStyle = "Dark"; - NSGlobalDomain._HIHideMenuBar = false; - - CustomUserPreferences = { - "com.apple.HIToolbox" = { - AppleEnabledInputSources = [ - { - InputSourceKind = "Keyboard Layout"; - "KeyboardLayout ID" = 0; - "KeyboardLayout Name" = "U.S."; - } - { - "Bundle ID" = "com.apple.CharacterPaletteIM"; - InputSourceKind = "Non Keyboard Input Method"; - } - { - InputSourceKind = "Keyboard Layout"; - "KeyboardLayout ID" = 19456; - "KeyboardLayout Name" = "Russian"; - } - ]; - AppleSelectedInputSources = [ - { - InputSourceKind = "Keyboard Layout"; - "KeyboardLayout ID" = 0; - "KeyboardLayout Name" = "U.S."; - } - ]; - }; - - "com.apple.symbolichotkeys".AppleSymbolicHotKeys = { - "28" = { - enabled = 1; - value = { - type = "standard"; - parameters = [ 51 20 1441792 ]; - }; - }; - "29" = { - enabled = 1; - value = { - type = "standard"; - parameters = [ 51 20 1179648 ]; - }; - }; - "30" = { - enabled = 1; - value = { - type = "standard"; - parameters = [ 52 21 1441792 ]; - }; - }; - "31" = { - enabled = 1; - value = { - type = "standard"; - parameters = [ 52 21 1179648 ]; - }; - }; - }; - - "NSGlobalDomain" = { - "AppleMenuBarVisibleInFullscreen" = true; - }; - }; - - controlcenter = { - BatteryShowPercentage = true; - }; - - trackpad = { - Clicking = true; - TrackpadThreeFingerDrag = false; - TrackpadRightClick = true; - }; - - finder = { - AppleShowAllExtensions = true; - ShowPathbar = true; - ShowStatusBar = true; - FXPreferredViewStyle = "clmv"; - NewWindowTarget = "Home"; - ShowExternalHardDrivesOnDesktop = false; - ShowHardDrivesOnDesktop = false; - FXEnableExtensionChangeWarning = false; - _FXShowPosixPathInTitle = true; - }; - - dock = { - tilesize = 48; - largesize = 64; - magnification = true; - orientation = "bottom"; - mineffect = "scale"; - autohide = true; - autohide-time-modifier = 0.8; - show-recents = false; - show-process-indicators = true; - static-only = false; - wvous-tl-corner = 1; - wvous-tr-corner = 4; - wvous-bl-corner = 1; - wvous-br-corner = 1; - persistent-apps = [ - "/System/Applications/System Settings.app" - "/Applications/Google Chrome.app" - "/System/Applications/Mail.app" - "/Applications/Telegram.app" - "/System/Applications/Calendar.app" - "/Applications/Obsidian.app" - "/Applications/VSCodium.app" - "/Users/michaotic/Applications/Home Manager Apps/kitty.app" - "/System/Applications/Books.app" - "/System/Applications/QuickTime Player.app" - ]; - }; - }; - - system.activationScripts.postActivation.text = '' - echo "Restarting Dock..." - sudo -u michaotic /usr/bin/killall Dock - ''; - - # Touch ID for sudo - security.pam.services.sudo_local.touchIdAuth = true; - - system.stateVersion = 7; - - # Home-manager configuration specific to poppy home-manager.users.michaotic = { imports = [ ../../home/kitty.nix ]; - programs.zsh.shellAliases = { switch = "darwin-rebuild switch --flake .#poppy"; update = "nix flake update && darwin-rebuild switch --flake .#poppy"; diff --git a/hosts/poppy/homebrew.nix b/hosts/poppy/homebrew.nix new file mode 100644 index 0000000..3d446a3 --- /dev/null +++ b/hosts/poppy/homebrew.nix @@ -0,0 +1,37 @@ +{ + homebrew.enable = true; + homebrew.onActivation.cleanup = "zap"; + + homebrew.taps = [ + "tw93/tap" + "typewhisper/tap" + ]; + + homebrew.brews = [ + "kew" + "mole" + ]; + + homebrew.casks = [ + "google-chrome" + "google-drive" + "bitwarden" + "marta" + "vscodium" + "github" + "docker-desktop" + "ollama-app" + "microsoft-word" + "microsoft-excel" + "microsoft-powerpoint" + "obsidian" + "anki" + "calibre" + "telegram" + "maccy" + "mos" + "caffeine" + "lunacy" + "skim" + ]; +} diff --git a/hosts/poppy/system.nix b/hosts/poppy/system.nix new file mode 100644 index 0000000..0cb3bb4 --- /dev/null +++ b/hosts/poppy/system.nix @@ -0,0 +1,127 @@ +{ pkgs, ... }: { + system.defaults = { + NSGlobalDomain.AppleInterfaceStyle = "Dark"; + NSGlobalDomain._HIHideMenuBar = false; + + CustomUserPreferences = { + "com.apple.HIToolbox" = { + AppleEnabledInputSources = [ + { + InputSourceKind = "Keyboard Layout"; + "KeyboardLayout ID" = 0; + "KeyboardLayout Name" = "U.S."; + } + { + "Bundle ID" = "com.apple.CharacterPaletteIM"; + InputSourceKind = "Non Keyboard Input Method"; + } + { + InputSourceKind = "Keyboard Layout"; + "KeyboardLayout ID" = 19456; + "KeyboardLayout Name" = "Russian"; + } + ]; + AppleSelectedInputSources = [ + { + InputSourceKind = "Keyboard Layout"; + "KeyboardLayout ID" = 0; + "KeyboardLayout Name" = "U.S."; + } + ]; + }; + + "com.apple.symbolichotkeys".AppleSymbolicHotKeys = { + "28" = { + enabled = 1; + value = { + type = "standard"; + parameters = [ 51 20 1441792 ]; + }; + }; + "29" = { + enabled = 1; + value = { + type = "standard"; + parameters = [ 51 20 1179648 ]; + }; + }; + "30" = { + enabled = 1; + value = { + type = "standard"; + parameters = [ 52 21 1441792 ]; + }; + }; + "31" = { + enabled = 1; + value = { + type = "standard"; + parameters = [ 52 21 1179648 ]; + }; + }; + }; + + "NSGlobalDomain" = { + "AppleMenuBarVisibleInFullscreen" = true; + }; + }; + + controlcenter = { + BatteryShowPercentage = true; + }; + + trackpad = { + Clicking = true; + TrackpadThreeFingerDrag = false; + TrackpadRightClick = true; + }; + + finder = { + AppleShowAllExtensions = true; + ShowPathbar = true; + ShowStatusBar = true; + FXPreferredViewStyle = "clmv"; + NewWindowTarget = "Home"; + ShowExternalHardDrivesOnDesktop = false; + ShowHardDrivesOnDesktop = false; + FXEnableExtensionChangeWarning = false; + _FXShowPosixPathInTitle = true; + }; + + dock = { + tilesize = 48; + largesize = 64; + magnification = true; + orientation = "bottom"; + mineffect = "scale"; + autohide = true; + autohide-time-modifier = 0.8; + show-recents = false; + show-process-indicators = true; + static-only = false; + wvous-tl-corner = 1; + wvous-tr-corner = 4; + wvous-bl-corner = 1; + wvous-br-corner = 1; + persistent-apps = [ + "/System/Applications/System Settings.app" + "/Applications/Google Chrome.app" + "/System/Applications/Mail.app" + "/Applications/Telegram.app" + "/System/Applications/Calendar.app" + "/Applications/Obsidian.app" + "/Applications/VSCodium.app" + "/Users/michaotic/Applications/Home Manager Apps/kitty.app" + "/System/Applications/Books.app" + "/System/Applications/QuickTime Player.app" + ]; + }; + }; + + system.activationScripts.postActivation.text = '' + echo "Restarting Dock..." + sudo -u michaotic /usr/bin/killall Dock + ''; + + security.pam.services.sudo_local.touchIdAuth = true; +}