From a08546158dde0b9c4397f9ebb896e9ff695c18b8 Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Sat, 2 Mar 2019 21:41:24 -0800 Subject: [PATCH 1/2] add trackpad configs: ActuationStrength, FirstClickThreshold, SecondClickThreshold --- modules/system/defaults/trackpad.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/system/defaults/trackpad.nix b/modules/system/defaults/trackpad.nix index 1fb1c901..a86a3477 100644 --- a/modules/system/defaults/trackpad.nix +++ b/modules/system/defaults/trackpad.nix @@ -29,5 +29,31 @@ with lib; ''; }; + system.defaults.trackpad.ActuationStrength = mkOption { + type = types.nullOr (types.enum [ 0 1 ]); + default = null; + description = '' + 0 to enable Silent Clicking, 1 to disable. The default is 1. + ''; + }; + + system.defaults.trackpad.FirstClickThreshold = mkOption { + type = types.nullOr (types.enum [ 0 1 2 ]); + default = null; + description = '' + For normal click: 0 for light clicking, 1 for medium, 2 for firm. + The default is 1. + ''; + }; + + system.defaults.trackpad.SecondClickThreshold = mkOption { + type = types.nullOr (types.enum [ 0 1 2 ]); + default = null; + description = '' + For force touch: 0 for light clicking, 1 for medium, 2 for firm. + The default is 1. + ''; + }; + }; } From f17fb87faba0a0f6b291ac5ecc19372a1d8720b5 Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Sat, 2 Mar 2019 21:41:50 -0800 Subject: [PATCH 2/2] Add NSGlobalDomain configs --- modules/system/defaults/NSGlobalDomain.nix | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/system/defaults/NSGlobalDomain.nix b/modules/system/defaults/NSGlobalDomain.nix index 984adf61..28fe60a9 100644 --- a/modules/system/defaults/NSGlobalDomain.nix +++ b/modules/system/defaults/NSGlobalDomain.nix @@ -232,6 +232,14 @@ in { ''; }; + system.defaults.NSGlobalDomain."com.apple.trackpad.scaling" = mkOption { + type = types.nullOr float; + default = null; + description = '' + Configures the trackpad tracking speed (0 to 3). The default is "1". + ''; + }; + system.defaults.NSGlobalDomain."com.apple.springing.enabled" = mkOption { type = types.nullOr types.bool; default = null; @@ -257,6 +265,30 @@ in { ''; }; + system.defaults.NSGlobalDomain.AppleMeasurementUnits = mkOption { + type = types.nullOr (types.enum [ "Centimeters" "Inches" ]); + default = null; + description = '' + Whether to use centimeters (metric) or inches (US, UK) as the measurement unit. The default is based on region settings. + ''; + }; + + system.defaults.NSGlobalDomain.AppleMetricUnits = mkOption { + type = types.nullOr (types.enum [ 0 1 ]); + default = null; + description = '' + Whether to use the metric system. The default is based on region settings. + ''; + }; + + system.defaults.NSGlobalDomain.AppleTemperatureUnit = mkOption { + type = types.nullOr (types.enum [ "Celsius" "Fahrenheit" ]); + default = null; + description = '' + Whether to use Celsius or Fahrenheit. The default is based on region settings. + ''; + }; + }; }