1{
2 user,
3 config,
4 pkgs,
5 lib,
6 ...
7}:
8let
9 tiling = config.shared.darwin.tiling.enable;
10in
11{
12 environment.systemPath = lib.mkIf config.homebrew.enable (lib.mkAfter [ "${config.homebrew.prefix}/bin" ]);
13
14 # Use touchid or watch to activate sudo
15 security.pam.services.sudo_local = {
16 enable = true;
17 reattach = true;
18 touchIdAuth = true;
19 };
20
21 # Set some OSX preferences that I always end up hunting down and changing.
22 system = {
23 primaryUser = user.username;
24 # Used for backwards compatibility, please read the changelog before changing.
25 # $ darwin-rebuild changelog
26 stateVersion = 6;
27
28 defaults = lib.mkDefault {
29 # Turn quarantine off
30 LaunchServices = {
31 LSQuarantine = false;
32 };
33
34 WindowManager = {
35 EnableStandardClickToShowDesktop = false;
36 };
37
38 NSGlobalDomain = {
39 # Show extensions in finder
40 AppleShowAllExtensions = true;
41 #Turn off the hold and press to input special chars
42 ApplePressAndHoldEnabled = false;
43
44 # 120, 90, 60, 30, 12, 6, 2
45 KeyRepeat = 2;
46
47 # 120, 94, 68, 35, 25, 15
48 InitialKeyRepeat = 15;
49
50 #Turn off beep noise in terminal
51 "com.apple.mouse.tapBehavior" = 1;
52 "com.apple.sound.beep.volume" = 0.0;
53 "com.apple.sound.beep.feedback" = 0;
54
55 #Ew.
56 NSAutomaticCapitalizationEnabled = false;
57 NSAutomaticDashSubstitutionEnabled = false;
58 NSAutomaticInlinePredictionEnabled = false;
59 NSAutomaticPeriodSubstitutionEnabled = false;
60 NSAutomaticQuoteSubstitutionEnabled = false;
61 NSAutomaticSpellingCorrectionEnabled = false;
62 NSDisableAutomaticTermination = true;
63 NSDocumentSaveNewDocumentsToCloud = false;
64 AppleICUForce24HourTime = true;
65
66 # Autohide menu bar for tiling window manager
67 _HIHideMenuBar = tiling;
68
69 # Use the expanded save dialog by default
70 NSNavPanelExpandedStateForSaveMode = true;
71 NSNavPanelExpandedStateForSaveMode2 = true;
72 };
73 # minimal dock
74 dock = {
75 autohide = true;
76 autohide-time-modifier = 0.0; # make animation instant
77 autohide-delay = 0.0; # remove delay when touching bottom of screen
78 show-process-indicators = true;
79
80 expose-group-apps = true;
81
82 show-recents = true;
83 static-only = true;
84
85 # Scale instead of shrink
86 mineffect = "scale";
87
88 orientation = "bottom";
89 };
90 # Better finder settings
91 finder = {
92 _FXShowPosixPathInTitle = true;
93 FXDefaultSearchScope = "SCcf";
94 AppleShowAllExtensions = true;
95 ShowPathbar = true;
96 FXEnableExtensionChangeWarning = false;
97 FXPreferredViewStyle = "Nlsv"; # List View
98 ShowExternalHardDrivesOnDesktop = false;
99 ShowHardDrivesOnDesktop = false;
100 ShowRemovableMediaOnDesktop = false;
101 NewWindowTarget = "Home";
102 };
103 CustomSystemPreferences = {
104 NSGlobalDomain = {
105 NSStatusItemSelectionPadding = 1;
106 NSStatusItemSelectionSpacing = 1;
107 };
108 "com.apple.universalaccess" = {
109 closeViewTrackpadGestureZoomEnabled = 1;
110 # TODO: enable zoom. this doesn't do enough
111 };
112 "com.apple.desktopservices" = {
113 # Prevents the Finder from reading DS_Store files on network
114 # shares, potentially. See https://support.apple.com/en-us/102064
115 DSDontWriteNetworkStores = 1;
116 };
117 "com.apple.dock" = {
118 workspaces-edge-delay = 0.15;
119 };
120 "com.apple.CrashReporter" = {
121 DialogType = "developer"; # display crash reports when apps crash.
122 };
123 };
124 };
125 # Bind caps to escape for better normal mode stuff
126 keyboard = {
127 enableKeyMapping = true;
128 remapCapsLockToEscape = true;
129 };
130 };
131}