From c3d9dceede33646bca6810e141ff832b453a49c2 Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Mon, 22 Jul 2019 11:05:48 -0400 Subject: [PATCH] Allow configuring external keyboard to use standard F-keys --- 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 28fe60a9..d519ce08 100644 --- a/modules/system/defaults/NSGlobalDomain.nix +++ b/modules/system/defaults/NSGlobalDomain.nix @@ -208,6 +208,14 @@ in { ''; }; + system.defaults.NSGlobalDomain."com.apple.keyboard.fnState" = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Use F1, F2, etc. keys as standard function keys. + ''; + }; + system.defaults.NSGlobalDomain."com.apple.mouse.tapBehavior" = mkOption { type = types.nullOr (types.enum [ 1 ]); default = null; diff --git a/tests/system-defaults-write.nix b/tests/system-defaults-write.nix index dc1560bf..e519463e 100644 --- a/tests/system-defaults-write.nix +++ b/tests/system-defaults-write.nix @@ -24,6 +24,7 @@ system.defaults.NSGlobalDomain.KeyRepeat = 1; system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint = true; system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint2 = true; + system.defaults.NSGlobalDomain."com.apple.keyboard.fnState" = true; system.defaults.NSGlobalDomain."com.apple.mouse.tapBehavior" = 1; system.defaults.NSGlobalDomain."com.apple.trackpad.enableSecondaryClick" = true; system.defaults.NSGlobalDomain."com.apple.trackpad.trackpadCornerClickBehavior" = 1; @@ -65,6 +66,7 @@ grep "defaults write -g 'KeyRepeat' -int 1" ${config.out}/activate-user grep "defaults write -g 'PMPrintingExpandedStateForPrint' -bool YES" ${config.out}/activate-user grep "defaults write -g 'PMPrintingExpandedStateForPrint2' -bool YES" ${config.out}/activate-user + grep "defaults write -g 'com.apple.keyboard.fnState' -bool YES" ${config.out}/activate-user grep "defaults write -g 'com.apple.mouse.tapBehavior' -int 1" ${config.out}/activate-user grep "defaults write -g 'com.apple.trackpad.enableSecondaryClick' -bool YES" ${config.out}/activate-user grep "defaults write -g 'com.apple.trackpad.trackpadCornerClickBehavior' -int 1" ${config.out}/activate-user