diff --git a/modules/darwin/dock.nix b/modules/darwin/dock.nix index 35bc60b..4acdc08 100644 --- a/modules/darwin/dock.nix +++ b/modules/darwin/dock.nix @@ -1,21 +1,38 @@ { system.defaults.dock = { - autohide = true; + autohide = true; + showhidden = true; # Translucent. mouse-over-hilite-stack = true; show-recents = false; mru-spaces = false; - tilesize = 48; + tilesize = 48; + magnification = false; enable-spring-load-actions-on-all-items = true; - expose-animation-duration = 0.1; - persistent-apps = [ { app = "/Applications/Zen.app"; } { app = "/Applications/Ghostty.app"; } ]; }; + + system.defaults.CustomSystemPreferences."com.apple.dock" = { + autohide-time-modifier = 0.0; + autohide-delay = 0.0; + expose-animation-duration = 0.0; + springboard-show-duration = 0.0; + springboard-hide-duration = 0.0; + springboard-page-duration = 0.0; + + # Disable hot corners. + wvous-tl-corner = 0; + wvous-tr-corner = 0; + wvous-bl-corner = 0; + wvous-br-corner = 0; + + launchanim = 0; + }; } diff --git a/modules/darwin/finder.nix b/modules/darwin/finder.nix index 15f69c3..b97baf9 100644 --- a/modules/darwin/finder.nix +++ b/modules/darwin/finder.nix @@ -26,10 +26,32 @@ NewWindowTarget = "Home"; + QuitMenuItem = true; # Allow quitting of Finder application + ShowExternalHardDrivesOnDesktop = true; ShowMountedServersOnDesktop = true; ShowPathbar = true; ShowRemovableMediaOnDesktop = true; ShowStatusBar = true; }; + + system.defaults.CustomSystemPreferences."com.apple.finder" = { + DisableAllAnimations = true; + + FXArrangeGroupViewBy = "Name"; + FxDefaultSearchScope = "SCcf"; # Search in current folder by default. + + WarnOnEmptyTrash = false; + }; + + home-manager.sharedModules = [(homeArgs: let + lib' = homeArgs.lib; + + inherit (lib'.hm.dag) entryAfter; + in { + home.activation.showLibrary = entryAfter [ "writeBoundary" ] /* bash */ '' + # Unhide ~/Library. + /usr/bin/chflags nohidden ~/Library + ''; + })]; } diff --git a/modules/darwin/localisation.nix b/modules/darwin/localisation.nix index b14cfb8..4bc4cf4 100644 --- a/modules/darwin/localisation.nix +++ b/modules/darwin/localisation.nix @@ -6,4 +6,10 @@ AppleMetricUnits = 1; AppleTemperatureUnit = "Celsius"; }; + + system.keyboard = { + enableKeyMapping = true; + + nonUS.remapTilde = true; + }; } diff --git a/modules/darwin/paperwm.nix b/modules/darwin/paperwm.nix index 187f732..13c0272 100644 --- a/modules/darwin/paperwm.nix +++ b/modules/darwin/paperwm.nix @@ -1,8 +1,10 @@ { config, lib, pkgs, ... }: let - inherit (lib) mkAfter mkIf; + inherit (lib) mkAfter; in { system.defaults.NSGlobalDomain = { - AppleInterfaceStyle = mkIf (lib.isDark config.theme) "Dark"; + _HIHideMenuBar = true; # Automatically hide/show the menu bar. + + AppleInterfaceStyle = if lib.isDark config.theme then "Dark" else null; AppleScrollerPagingBehavior = true; # Jump to the spot that was pressed in the scrollbar. AppleShowScrollBars = "WhenScrolling"; @@ -12,16 +14,16 @@ in { AppleEnableSwipeNavigateWithScrolls = false; AppleWindowTabbingMode = "always"; # Always prefer tabs for new windows. - AppleKeyboardUIMode = 3; # Full keyboard access. - ApplePressAndHoldEnabled = false; # No ligatures when you press and hold a key, just repeat it. + AppleKeyboardUIMode = 3; # Full keyboard access. + ApplePressAndHoldEnabled = false; # No ligatures when you press and hold a key, just repeat it. NSScrollAnimationEnabled = true; - NSWindowResizeTime = 0.001; + NSWindowResizeTime = 0.003; "com.apple.keyboard.fnState" = false; # Don't invert Fn. - "com.apple.trackpad.scaling" = 1.5; # Faster mouse speed. + "com.apple.trackpad.scaling" = 1.5; # Faster mouse speed. - InitialKeyRepeat = 15; + InitialKeyRepeat = 12; KeyRepeat = 1; NSAutomaticCapitalizationEnabled = false; @@ -29,8 +31,15 @@ in { NSAutomaticInlinePredictionEnabled = false; NSAutomaticPeriodSubstitutionEnabled = false; NSAutomaticQuoteSubstitutionEnabled = false; + + NSNavPanelExpandedStateForSaveMode = true; # Expand save panel by default. + PMPrintingExpandedStateForPrint = true; # Expand print panel by default. + + AppleSpacesSwitchOnActivate = false; # Do not switch workspaces implicitly. }; + system.defaults.CustomSystemPreferences."com.apple.dock".workspaces-auto-swoosh = false; # Read `AppleSpacesSwitchOnActivate`. + system.defaults.CustomSystemPreferences."com.apple.AppleMultitouchTrackpad" = { TrackpadThreeFingerVertSwipeGesture = 0; # Four finger swipe up for mission control. diff --git a/modules/darwin/screencapture.nix b/modules/darwin/screencapture.nix new file mode 100644 index 0000000..5e169cd --- /dev/null +++ b/modules/darwin/screencapture.nix @@ -0,0 +1,3 @@ +{ + system.defaults.screencapture.location = "~/Downloads"; +} diff --git a/modules/darwin/screensaver.nix b/modules/darwin/screensaver.nix new file mode 100644 index 0000000..73462b4 --- /dev/null +++ b/modules/darwin/screensaver.nix @@ -0,0 +1,7 @@ +{ + system.defaults.CustomSystemPreferences."com.apple.screensaver" = { + # Request password immediately. + askForPassword = 1; + askForPasswordDelay = 0; + }; +} diff --git a/modules/darwin/trackpad.nix b/modules/darwin/trackpad.nix new file mode 100644 index 0000000..6e73a8a --- /dev/null +++ b/modules/darwin/trackpad.nix @@ -0,0 +1,6 @@ +{ + system.defaults.trackpad = { + Clicking = false; # No touch-to-click. + Dragging = false; # No tap-to-drag. + }; +}