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