From 55f4331e739904ded81ede32117d12301c2cfbaa Mon Sep 17 00:00:00 2001 From: cmacrae Date: Tue, 27 Feb 2018 17:24:45 +0000 Subject: [PATCH 1/3] defaults: Add screencapture.location --- default.nix | 1 + modules/examples/lnl.nix | 2 ++ modules/system/defaults-write.nix | 4 +++- modules/system/defaults/screencapture.nix | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 modules/system/defaults/screencapture.nix diff --git a/default.nix b/default.nix index a2528d3f..2007a8e0 100644 --- a/default.nix +++ b/default.nix @@ -28,6 +28,7 @@ let ./modules/system/defaults/NSGlobalDomain.nix ./modules/system/defaults/dock.nix ./modules/system/defaults/finder.nix + ./modules/system/defaults/screencapture.nix ./modules/system/defaults/smb.nix ./modules/system/defaults/trackpad.nix ./modules/system/etc.nix diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix index 23235125..df674ae2 100644 --- a/modules/examples/lnl.nix +++ b/modules/examples/lnl.nix @@ -21,6 +21,8 @@ system.defaults.finder.QuitMenuItem = true; system.defaults.finder.FXEnableExtensionChangeWarning = false; + system.defaults.screencapture.location = "/tmp"; + system.defaults.trackpad.Clicking = true; system.defaults.trackpad.TrackpadThreeFingerDrag = true; diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index e1ec96c3..80ffb081 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -26,6 +26,7 @@ let dock = defaultsToList "com.apple.dock" cfg.dock; finder = defaultsToList "com.apple.finder" cfg.finder; smb = defaultsToList "/Library/Preferences/SystemConfiguration/com.apple.smb.server" cfg.smb; + screencapture = defaultsToList "com.apple.screencapture" cfg.screencapture; trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad; trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad; @@ -43,7 +44,7 @@ in ''; system.activationScripts.userDefaults.text = mkIfAttrs - [ NSGlobalDomain LaunchServices dock finder trackpad trackpadBluetooth ] + [ NSGlobalDomain LaunchServices dock finder screencapture trackpad trackpadBluetooth ] '' # Set defaults echo >&2 "user defaults..." @@ -52,6 +53,7 @@ in ${concatStringsSep "\n" LaunchServices} ${concatStringsSep "\n" dock} ${concatStringsSep "\n" finder} + ${concatStringsSep "\n" screencapture} ${concatStringsSep "\n" trackpad} ${concatStringsSep "\n" trackpadBluetooth} ''; diff --git a/modules/system/defaults/screencapture.nix b/modules/system/defaults/screencapture.nix new file mode 100644 index 00000000..42fe6b69 --- /dev/null +++ b/modules/system/defaults/screencapture.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: + +with lib; + +{ + options = { + + system.defaults.screencapture.location = mkOption { + type = types.string; + default = "~/Desktop"; + description = '' + The filesystem path to which screencaptures should be written. + ''; + }; + }; +} From 93f0692422abe6ce8eed23c38920e854a49a9a3a Mon Sep 17 00:00:00 2001 From: cmacrae Date: Wed, 28 Feb 2018 08:21:30 +0000 Subject: [PATCH 2/3] examples: remove screencapture.location from @LnL's confg (sorry!) --- modules/examples/lnl.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix index df674ae2..23235125 100644 --- a/modules/examples/lnl.nix +++ b/modules/examples/lnl.nix @@ -21,8 +21,6 @@ system.defaults.finder.QuitMenuItem = true; system.defaults.finder.FXEnableExtensionChangeWarning = false; - system.defaults.screencapture.location = "/tmp"; - system.defaults.trackpad.Clicking = true; system.defaults.trackpad.TrackpadThreeFingerDrag = true; From 9a1499b12899157a2fb8b0e3394d96e8fff5e954 Mon Sep 17 00:00:00 2001 From: cmacrae Date: Thu, 1 Mar 2018 13:20:16 +0000 Subject: [PATCH 3/3] defaults: set screencapture.location's default to null --- modules/system/defaults/screencapture.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/defaults/screencapture.nix b/modules/system/defaults/screencapture.nix index 42fe6b69..a101c005 100644 --- a/modules/system/defaults/screencapture.nix +++ b/modules/system/defaults/screencapture.nix @@ -6,8 +6,8 @@ with lib; options = { system.defaults.screencapture.location = mkOption { - type = types.string; - default = "~/Desktop"; + type = types.nullOr types.str; + default = null; description = '' The filesystem path to which screencaptures should be written. '';