mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Merge pull request #357 from eraserhd/magic-mouse
defaults: magic mouse option
This commit is contained in:
commit
39af16ede5
3 changed files with 27 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
'';
|
||||
|
||||
};
|
||||
|
|
21
modules/system/defaults/magicmouse.nix
Normal file
21
modules/system/defaults/magicmouse.nix
Normal file
|
@ -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.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue