From 2ffb75f9423eb85c4ba5fa043b356f83e0586163 Mon Sep 17 00:00:00 2001 From: Moritz Rumpf Date: Wed, 28 Feb 2024 14:44:09 +0100 Subject: [PATCH 1/2] defaults: Add options for dragOnGesture feature This is just a rebased version of https://github.com/LnL7/nix-darwin/pull/513 Credit to @2gn --- modules/system/defaults/NSGlobalDomain.nix | 8 ++++++++ tests/system-defaults-write.nix | 2 ++ 2 files changed, 10 insertions(+) diff --git a/modules/system/defaults/NSGlobalDomain.nix b/modules/system/defaults/NSGlobalDomain.nix index 4f08d4a..3a18de6 100644 --- a/modules/system/defaults/NSGlobalDomain.nix +++ b/modules/system/defaults/NSGlobalDomain.nix @@ -225,6 +225,14 @@ in { ''; }; + system.defaults.NSGlobalDomain.NSWindowShouldDragOnGesture = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Whether to enable moving window by holding anywhere on it like on Linux. The default is false. + ''; + }; + system.defaults.NSGlobalDomain.InitialKeyRepeat = mkOption { type = types.nullOr types.int; default = null; diff --git a/tests/system-defaults-write.nix b/tests/system-defaults-write.nix index e3f69fe..4745efd 100644 --- a/tests/system-defaults-write.nix +++ b/tests/system-defaults-write.nix @@ -27,6 +27,7 @@ system.defaults.NSGlobalDomain.NSUseAnimatedFocusRing = false; system.defaults.NSGlobalDomain.NSScrollAnimationEnabled = true; system.defaults.NSGlobalDomain.NSWindowResizeTime = 0.01; + system.defaults.NSGlobalDomain.NSWindowShouldDragOnGesture = true; system.defaults.NSGlobalDomain.InitialKeyRepeat = 10; system.defaults.NSGlobalDomain.KeyRepeat = 1; system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint = true; @@ -99,6 +100,7 @@ grep "defaults write -g 'NSUseAnimatedFocusRing' -bool NO" ${config.out}/activate-user grep "defaults write -g 'NSScrollAnimationEnabled' -bool YES" ${config.out}/activate-user grep "defaults write -g 'NSWindowResizeTime' -float 0.01" ${config.out}/activate-user + grep "defaults write -g 'NSWindowShouldDragOnGesture' -bool YES" ${config.out}/activate-user grep "defaults write -g 'InitialKeyRepeat' -int 10" ${config.out}/activate-user grep "defaults write -g 'KeyRepeat' -int 1" ${config.out}/activate-user grep "defaults write -g 'PMPrintingExpandedStateForPrint' -bool YES" ${config.out}/activate-user From ad98aebc0f900fa9bef8dfa8f5bdb328ab93ccd3 Mon Sep 17 00:00:00 2001 From: Moritz Rumpf Date: Wed, 28 Feb 2024 15:02:27 +0100 Subject: [PATCH 2/2] Fix doc render problem This fixes: ``` RuntimeError: can't render html in the presence of docbook ``` --- modules/system/defaults/NSGlobalDomain.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/defaults/NSGlobalDomain.nix b/modules/system/defaults/NSGlobalDomain.nix index 3a18de6..03a7da2 100644 --- a/modules/system/defaults/NSGlobalDomain.nix +++ b/modules/system/defaults/NSGlobalDomain.nix @@ -228,7 +228,7 @@ in { system.defaults.NSGlobalDomain.NSWindowShouldDragOnGesture = mkOption { type = types.nullOr types.bool; default = null; - description = '' + description = lib.mdDoc '' Whether to enable moving window by holding anywhere on it like on Linux. The default is false. ''; };