···33 ./brew # homebrew the package manager
44 ./hardware # hardware config - i.e. keyboard
55 ./prefrences # system preferences
66+ ./security # security settings to keep the system secure
67 ./services # services exclusive to nix-darwin
7889 ./activation.nix # run when we start the system
-61
modules/darwin/non-native.nix
···11-{
22- # Customize settings that not supported by nix-darwin directly
33- # see the source code of this project to get more undocumented options:
44- # https://github.com/rgcr/m-cli
55- #
66- # All custom entries can be found by running `defaults read` command.
77- # or `defaults read xxx` to read a specific domain.
88- system.defaults.CustomUserPreferences = {
99- NSGlobalDomain = {
1010- # Add a context menu item for showing the Web Inspector in web views
1111- WebKitDeveloperExtras = true;
1212- };
1313-1414- "com.apple.desktopservices" = {
1515- # Avoid creating .DS_Store files on network or USB volumes
1616- DSDontWriteNetworkStores = true;
1717- DSDontWriteUSBStores = true;
1818- };
1919-2020- "com.apple.spaces" = {
2121- "spans-displays" = 0; # Display have seperate spaces
2222- };
2323-2424- "com.apple.WindowManager" = {
2525- EnableStandardClickToShowDesktop = 0; # Click wallpaper to reveal desktop
2626- StandardHideDesktopIcons = 0; # Show items on desktop
2727- HideDesktop = 0; # Do not hide items on desktop & stage manager
2828- StageManagerHideWidgets = 0;
2929- StandardHideWidgets = 0;
3030- };
3131-3232- "com.apple.screensaver" = {
3333- # Require password immediately after sleep or screen saver begins
3434- askForPassword = 1;
3535- askForPasswordDelay = 0;
3636- };
3737-3838- "com.apple.screencapture" = {
3939- location = "~/Pictures/screenshots";
4040- type = "png";
4141- };
4242-4343- "com.apple.AdLib" = {
4444- allowApplePersonalizedAdvertising = false;
4545- };
4646-4747- # Prevent Photos from opening automatically when devices are plugged in
4848- "com.apple.ImageCapture".disableHotPlug = true;
4949-5050- # modified from https://github.com/nmasur/dotfiles/blob/275863795317f8ce65486b138c1fb4eb6dbd65f8/modules/darwin/system.nix#L134-L148
5151- # "com.apple.dock".persistent-apps = let
5252- # dockText = app: "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>'${app}'</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>";
5353- # in
5454- # map dockText [
5555- # "/Applications/Arc.app"
5656- # "/Users/isabel/Applications/Home Manager Apps/WezTerm.app"
5757- # "/Users/isabel/Applications/Home Manager Apps/Discord.app"
5858- # "${pkgs.obsidian}/Applications/Obsidian.app"
5959- # ];
6060- };
6161-}
+19-9
modules/darwin/prefrences/default.nix
···11-# All the configuration options are documented here: https://daiderd.com/nix-darwin/manual/index.html#sec-options
22-# Incomplete list of macOS `defaults` commands: https://macos-defaults.com/
11+# All the configuration options are documented here: https://daiderd.com/nix-darwin/manual/index.html#sec-options
22+# Incomplete list of macOS `defaults` commands: https://macos-defaults.com/
33+#
44+# This pertains to anything prefixed with CustomUserPreferences
55+# Customize settings that not supported by nix-darwin directly
66+# see the source code of this project to get more undocumented options:
77+# https://github.com/rgcr/m-cli
88+#
99+# All custom entries can be found by running `defaults read` command.
1010+# or `defaults read xxx` to read a specific domain.
311{
412 imports = [
55- ./clock.nix
66- ./dock.nix
77- ./finder.nix
88- ./login.nix
99- ./misc.nix
1010- ./sound.nix
1111- ./theme.nix
1313+ ./clock.nix # Settings for the clock in the menu bar
1414+ ./dock.nix # Settings for the dock
1515+ ./finder.nix # Settings for Finder (file manager)
1616+ ./images.nix # Screensaver, screenshots etc
1717+ ./login.nix # Settings for the login screen
1818+ ./misc.nix # Miscellaneous settings
1919+ ./sound.nix # Sound settings
2020+ ./theme.nix # Theme settings
2121+ ./wm.nix # Window manager settings
1222 ];
1323}
···11+{
22+ system.defaults.CustomUserPreferences = {
33+ "com.apple.screensaver" = {
44+ # Require password immediately after sleep or screen saver begins
55+ askForPassword = 1;
66+ askForPasswordDelay = 0;
77+ };
88+99+ "com.apple.screencapture" = {
1010+ location = "~/Pictures/screenshots";
1111+ type = "png";
1212+ };
1313+1414+ # Prevent Photos from opening automatically when devices are plugged in
1515+ "com.apple.ImageCapture".disableHotPlug = true;
1616+ };
1717+}
+19-8
modules/darwin/prefrences/misc.nix
···11{
22- system.defaults.NSGlobalDomain = {
33- NSAutomaticCapitalizationEnabled = false; # disable auto capitalization
44- NSAutomaticDashSubstitutionEnabled = false; # disable auto dash substitution
55- NSAutomaticPeriodSubstitutionEnabled = false; # disable auto period substitution
66- NSAutomaticQuoteSubstitutionEnabled = false; # disable auto quote substitution
77- NSAutomaticSpellingCorrectionEnabled = false; # disable auto spelling correction
88- NSNavPanelExpandedStateForSaveMode = true; # expand save panel by default
99- NSNavPanelExpandedStateForSaveMode2 = true; # ^
22+ system.defaults = {
33+ NSGlobalDomain = {
44+ # Add a context menu item for showing the Web Inspector in web views
55+ WebKitDeveloperExtras = true;
66+77+ NSAutomaticCapitalizationEnabled = false; # disable auto capitalization
88+ NSAutomaticDashSubstitutionEnabled = false; # disable auto dash substitution
99+ NSAutomaticPeriodSubstitutionEnabled = false; # disable auto period substitution
1010+ NSAutomaticQuoteSubstitutionEnabled = false; # disable auto quote substitution
1111+ NSAutomaticSpellingCorrectionEnabled = false; # disable auto spelling correction
1212+ NSNavPanelExpandedStateForSaveMode = true; # expand save panel by default
1313+ NSNavPanelExpandedStateForSaveMode2 = true; # ^
1414+ };
1515+ };
1616+1717+ CustomUserPreferences."com.apple.desktopservices" = {
1818+ # Avoid creating .DS_Store files on network or USB volumes
1919+ DSDontWriteNetworkStores = true;
2020+ DSDontWriteUSBStores = true;
1021 };
1122}
+15
modules/darwin/prefrences/wm.nix
···11+{
22+ system.defaults.CustomUserPreferences = {
33+ "com.apple.spaces" = {
44+ "spans-displays" = 0; # Display have seperate spaces
55+ };
66+77+ "com.apple.WindowManager" = {
88+ EnableStandardClickToShowDesktop = 0; # Click wallpaper to reveal desktop
99+ StandardHideDesktopIcons = 0; # Show items on desktop
1010+ HideDesktop = 0; # Do not hide items on desktop & stage manager
1111+ StageManagerHideWidgets = 0;
1212+ StandardHideWidgets = 0;
1313+ };
1414+ };
1515+}
-7
modules/darwin/security.nix
···11-{
22- security.pam.enableSudoTouchIdAuth = true;
33-44- # Apple menu > System Preferences > Security and firewall
55- # Drops incoming requests via ICMP such as ping requests. Default is 0.
66- system.defaults.alf.stealthenabled = 1; # enabled
77-}