mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
defaults: add options for common universalaccess
settings
This commit is contained in:
parent
7709d31d76
commit
1cf5705283
4 changed files with 48 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
./system/defaults/SoftwareUpdate.nix
|
||||
./system/defaults/spaces.nix
|
||||
./system/defaults/trackpad.nix
|
||||
./system/defaults/universalaccess.nix
|
||||
./system/etc.nix
|
||||
./system/keyboard.nix
|
||||
./system/launchd.nix
|
||||
|
|
|
@ -39,6 +39,7 @@ let
|
|||
spaces = defaultsToList "com.apple.spaces" cfg.spaces;
|
||||
trackpad = defaultsToList "com.apple.AppleMultitouchTrackpad" cfg.trackpad;
|
||||
trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad;
|
||||
universalaccess = defaultsToList "com.apple.universalaccess" cfg.universalaccess;
|
||||
|
||||
mkIfAttrs = list: mkIf (any (attrs: attrs != { }) list);
|
||||
in
|
||||
|
@ -74,6 +75,7 @@ in
|
|||
spaces
|
||||
trackpad
|
||||
trackpadBluetooth
|
||||
universalaccess
|
||||
]
|
||||
''
|
||||
# Set defaults
|
||||
|
@ -91,6 +93,7 @@ in
|
|||
${concatStringsSep "\n" spaces}
|
||||
${concatStringsSep "\n" trackpad}
|
||||
${concatStringsSep "\n" trackpadBluetooth}
|
||||
${concatStringsSep "\n" universalaccess}
|
||||
'';
|
||||
|
||||
};
|
||||
|
|
38
modules/system/defaults/universalaccess.nix
Normal file
38
modules/system/defaults/universalaccess.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options = {
|
||||
|
||||
system.defaults.universalaccess.reduceTransparency = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Disable transparency in the menu bar and elsewhere.
|
||||
Requires macOS Yosemite or later.
|
||||
The default is false.
|
||||
'';
|
||||
};
|
||||
|
||||
system.defaults.universalaccess.closeViewScrollWheelToggle = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Use scroll gesture with the Ctrl (^) modifier key to zoom.
|
||||
The default is false.
|
||||
'';
|
||||
};
|
||||
|
||||
system.defaults.universalaccess.closeViewZoomFollowsFocus = mkOption {
|
||||
type = types.nullOr types.bool;
|
||||
default = null;
|
||||
description = ''
|
||||
Follow the keyboard focus while zoomed in.
|
||||
Without setting `closeViewScrollWheelToggle` this has no effect.
|
||||
The default is false.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
}
|
|
@ -39,6 +39,9 @@
|
|||
system.defaults.screencapture.location = "/tmp";
|
||||
system.defaults.smb.NetBIOSName = "IMAC-000000";
|
||||
system.defaults.smb.ServerDescription = ''Darwin\\\\U2019s iMac'';
|
||||
system.defaults.universalaccess.reduceTransparency = true;
|
||||
system.defaults.universalaccess.closeViewScrollWheelToggle = true;
|
||||
system.defaults.universalaccess.closeViewZoomFollowsFocus = true;
|
||||
|
||||
test = ''
|
||||
echo >&2 "checking defaults write in /activate"
|
||||
|
@ -82,5 +85,8 @@
|
|||
grep "defaults write com.apple.dock 'autohide-delay' -float 0.24" ${config.out}/activate-user
|
||||
grep "defaults write com.apple.dock 'orientation' -string 'left'" ${config.out}/activate-user
|
||||
grep "defaults write com.apple.screencapture 'location' -string '/tmp'" ${config.out}/activate-user
|
||||
grep "defaults write com.apple.universalaccess 'reduceTransparency' -bool YES" ${config.out}/activate-user
|
||||
grep "defaults write com.apple.universalaccess 'closeViewScrollWheelToggle' -bool YES" ${config.out}/activate-user
|
||||
grep "defaults write com.apple.universalaccess 'closeViewZoomFollowsFocus' -bool YES" ${config.out}/activate-user
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue