ctucx.git: nixfiles

ctucx' nixfiles

commit 51968a1010b5b3bc5e67b65d65c1ff1ad3c4f226
parent 791a702195431a94e65c335a9e40bceadba834f9
Author: Leah (ctucx) <git@ctu.cx>
Date: Tue, 6 Dec 2022 17:04:29 +0100

configurations/darwin/finder: configure via `system.defaults.CustomUserPreferences`
1 file changed, 34 insertions(+), 17 deletions(-)
M
configurations/darwin/finder.nix
|
51
++++++++++++++++++++++++++++++++++-----------------
diff --git a/configurations/darwin/finder.nix b/configurations/darwin/finder.nix
@@ -3,32 +3,49 @@
 {
 
   system.activationScripts.extraUserActivation.text = ''
-    # Avoid creating .DS_Store files on network or USB volumes
-    defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
-    defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
-
-    # Automatically open a new Finder window when a volume is mounted
-    defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
-    defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
-    defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
-
     # Set defaults for panes in Finder's "Get Info"
     defaults write com.apple.finder FXInfoPanesExpanded -dict \
       General -bool true \
       OpenWith -bool true \
       Privileges -bool true \
       Preview -bool false
+  '';
+
+  system.defaults.CustomUserPreferences = {
+    # Avoid creating .DS_Store files on network or USB volumes
+    "com.apple.desktopservices" = {
+      DSDontWriteNetworkStores = true;
+      DSDontWriteUSBStores     = true;
+    };
 
-    # disable animation when opening the info window in finder (CMD + I)
-    defaults write com.apple.finder DisableAllAnimations -bool true
+    # Automatically open a new Finder window when a volume is mounted
+    "com.apple.finder".OpenWindowForNewRemovableDisk = true;
+    "com.apple.frameworks.diskimages" = {
+      auto-open-ro-root = true;
+      auto-open-rw-root = true;
+    };
 
-    # keep folders on top when sorting by name
-    defaults write com.apple.finder _FXSortFoldersFirst -bool true
+    "com.apple.finder" = {
+      # Set defaults for panes in Finder's "Get Info"
+      #FXInfoPanesExpanded = {
+      #  General    = true;
+      #  OpenWith   = true;
+      #  Privileges = true;
+      #  Preview    = false;
+      #};
+
+      # disable animation when opening the info window in finder (CMD + I)
+      DisableAllAnimations = true;
+
+      # keep folders on top when sorting by name
+      "_FXSortFoldersFirst" = true;
+
+      # Set $HOME as the default location for new Finder windows
+      NewWindowTarget     = "PfLo";
+      NewWindowTargetPath = "file://${config.home-manager.users.leah.home.homeDirectory}";
+    };
+  };
 
-    # Set $HOME as the default location for new Finder windows
-    defaults write com.apple.finder NewWindowTarget -string "PfLo"
-    defaults write com.apple.finder NewWindowTargetPath -string "file://${config.home-manager.users.leah.home.homeDirectory}"
-  '';
 
   system.defaults = {
     NSGlobalDomain = {