diff options
| author | Jason Felice <jason.m.felice@gmail.com> | 2021-08-24 17:13:48 -0400 |
|---|---|---|
| committer | Jason Felice <jason.m.felice@gmail.com> | 2021-08-24 17:13:48 -0400 |
| commit | 998fbfc0398079326094a7f97e8d8745d0f49d82 (patch) | |
| tree | 27fcb68fc407cb5dd4690be89b456c5b87e7c07d /modules | |
| parent | 007d700e644ac588ad6668e6439950a5b6e2ff64 (diff) | |
defaults: magic mouse option
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/module-list.nix | 1 | ||||
| -rw-r--r-- | modules/system/defaults-write.nix | 6 | ||||
| -rw-r--r-- | modules/system/defaults/magicmouse.nix | 21 |
3 files changed, 27 insertions, 1 deletions
diff --git a/modules/module-list.nix b/modules/module-list.nix index 85dcaf2..e7fd2af 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -16,6 +16,7 @@ ./system/defaults/screencapture.nix ./system/defaults/alf.nix ./system/defaults/loginwindow.nix + ./system/defaults/magicmouse.nix ./system/defaults/smb.nix ./system/defaults/SoftwareUpdate.nix ./system/defaults/spaces.nix diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index 6c79138..8342984 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -34,6 +34,8 @@ let spaces = defaultsToList "com.apple.spaces" cfg.spaces; trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad; trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad; + magicmouse = defaultsToList "com.apple.AppleMultitouchMouse" cfg.magicmouse; + magicmouseBluetooth = defaultsToList "com.apple.driver.AppleMultitouchMouse.mouse" cfg.magicmouse; mkIfAttrs = list: mkIf (any (attrs: attrs != {}) list); in @@ -52,7 +54,7 @@ in ''; system.activationScripts.userDefaults.text = mkIfAttrs - [ NSGlobalDomain GlobalPreferences LaunchServices dock finder screencapture spaces trackpad trackpadBluetooth ] + [ NSGlobalDomain GlobalPreferences LaunchServices dock finder screencapture spaces trackpad trackpadBluetooth magicmouse magicmouseBluetooth ] '' # Set defaults echo >&2 "user defaults..." @@ -66,6 +68,8 @@ in ${concatStringsSep "\n" spaces} ${concatStringsSep "\n" trackpad} ${concatStringsSep "\n" trackpadBluetooth} + ${concatStringsSep "\n" magicmouse} + ${concatStringsSep "\n" magicmouseBluetooth} ''; }; diff --git a/modules/system/defaults/magicmouse.nix b/modules/system/defaults/magicmouse.nix new file mode 100644 index 0000000..9344ffe --- /dev/null +++ b/modules/system/defaults/magicmouse.nix @@ -0,0 +1,21 @@ +{ config, lib, ... }: + +with lib; + +{ + options = { + + system.defaults.magicmouse.MouseButtonMode = mkOption { + type = types.nullOr (types.enum [ + "OneButton" + "TwoButton" + ]); + default = null; + description = '' + "OneButton": any tap is a left click. "TwoButton": allow left- + and right-clicking. + ''; + }; + + }; +} |
