Skip to content

Commit f5b4b4f

Browse files
committed
feat: add defaults settings
1 parent 0cc8b57 commit f5b4b4f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

default.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
};
9898

9999
defaults = {
100+
# https://macos-defaults.com/
100101
NSGlobalDomain.ApplePressAndHoldEnabled = false;
101102
NSGlobalDomain.AppleShowAllExtensions = true;
102103
NSGlobalDomain.KeyRepeat = 4;
@@ -115,6 +116,10 @@
115116
# https://apple.stackexchange.com/a/462849
116117
NSGlobalDomain.NSInitialToolTipDelay = 800;
117118

119+
# https://apple.stackexchange.com/a/424110
120+
# This requires to grant full disk access to the terminal!
121+
"com.apple.universalaccess".showWindowTitlebarIcons = true;
122+
118123
# tweaks
119124
"com.apple.finder".QuitMenuItem = true;
120125
"com.apple.finder".PathBarRootAtHome = true;
@@ -124,6 +129,16 @@
124129
};
125130
};
126131

132+
home.activation.checkFullDiskAccess = lib.mkIf pkgs.stdenv.isDarwin (
133+
lib.hm.dag.entryBefore [ "setDarwinDefaults" "writeBoundary" ] ''
134+
if ! run --quiet plutil -lint /Library/Preferences/com.apple.TimeMachine.plist; then
135+
errorEcho "Full Disk Access is not granted to the current terminal!"
136+
run open "x-apple.systempreferences:com.apple.preference.security?Privacy_All"
137+
exit 1
138+
fi
139+
''
140+
);
141+
127142
programs.direnv = {
128143
enable = true;
129144
nix-direnv.enable = true;

0 commit comments

Comments
 (0)