mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Merge pull request #62 from pjan/enh/NSGlobalDomain
Adds more NSGlobalDomain options + tests
This commit is contained in:
commit
52cf461055
2 changed files with 201 additions and 28 deletions
|
@ -2,9 +2,27 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
let
|
||||||
|
isFloat = x: isString x && builtins.match "^[+-]?([0-9]*[.])?[0-9]+$" x != null;
|
||||||
|
|
||||||
|
float = mkOptionType {
|
||||||
|
name = "float";
|
||||||
|
description = "float";
|
||||||
|
check = isFloat;
|
||||||
|
merge = options.mergeOneOption;
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.AppleFontSmoothing = mkOption {
|
||||||
|
type = types.nullOr (types.enum [ 0 1 2 ]);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Sets the level of font smoothing (sub-pixel font rendering).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.AppleKeyboardUIMode = mkOption {
|
system.defaults.NSGlobalDomain.AppleKeyboardUIMode = mkOption {
|
||||||
type = types.nullOr (types.enum [ 3 ]);
|
type = types.nullOr (types.enum [ 3 ]);
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -21,27 +39,19 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.InitialKeyRepeat = mkOption {
|
system.defaults.NSGlobalDomain.AppleShowAllExtensions = mkOption {
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.bool;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
# Apple menu > System Preferences > Keyboard
|
Whether to show all file extensions in finder. The default is false.
|
||||||
If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat.
|
|
||||||
For example, the Delete key continues to remove text for as long as you hold it down.
|
|
||||||
|
|
||||||
This sets how long you must hold down the key before it starts repeating.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.KeyRepeat = mkOption {
|
system.defaults.NSGlobalDomain.AppleShowScrollBars = mkOption {
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr (types.enum [ "WhenScrolling" "Automatic" "Always" ]);
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
# Apple menu > System Preferences > Keyboard
|
When to show the scrollbars. Options are 'WhenScrolling', 'Automatic' and 'Always'.
|
||||||
If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat.
|
|
||||||
For example, the Delete key continues to remove text for as long as you hold it down.
|
|
||||||
|
|
||||||
This sets how fast it repeats once it starts.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,14 +63,6 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.NSAutomaticQuoteSubstitutionEnabled = mkOption {
|
|
||||||
type = types.nullOr types.bool;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Whether to enable smart quote substitution. The default is true.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.NSAutomaticDashSubstitutionEnabled = mkOption {
|
system.defaults.NSGlobalDomain.NSAutomaticDashSubstitutionEnabled = mkOption {
|
||||||
type = types.nullOr types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -77,6 +79,14 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.NSAutomaticQuoteSubstitutionEnabled = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to enable smart quote substitution. The default is true.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.NSAutomaticSpellingCorrectionEnabled = mkOption {
|
system.defaults.NSGlobalDomain.NSAutomaticSpellingCorrectionEnabled = mkOption {
|
||||||
type = types.nullOr types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -85,6 +95,14 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.NSDisableAutomaticTermination = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to disable the automatic termination of inactive apps.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain.NSDocumentSaveNewDocumentsToCloud = mkOption {
|
system.defaults.NSGlobalDomain.NSDocumentSaveNewDocumentsToCloud = mkOption {
|
||||||
type = types.nullOr types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -109,19 +127,84 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain."com.apple.trackpad.enableSecondaryClick" = mkOption {
|
system.defaults.NSGlobalDomain.NSTableViewDefaultSizeMode = mkOption {
|
||||||
type = types.nullOr types.bool;
|
type = types.nullOr (types.enum [ 1 2 3 ]);
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable trackpad secondary click. The default is true.
|
Sets the size of the finder sidebar icons: 1 (small), 2 (medium) or 3 (large). The default is 3.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = mkOption {
|
system.defaults.NSGlobalDomain.NSTextShowsControlCharacters = mkOption {
|
||||||
type = types.nullOr types.bool;
|
type = types.nullOr types.bool;
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable "Natural" scrolling direction. The default is true.
|
Whether to display ASCII control characters using caret notation in standard text views. The default is false.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.NSUseAnimatedFocusRing = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to enable the focus ring animation. The default is true.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.NSScrollAnimationEnabled = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to enable smooth scrolling. The default is true.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.NSWindowResizeTime = mkOption {
|
||||||
|
type = types.nullOr float;
|
||||||
|
default = null;
|
||||||
|
example = "0.20";
|
||||||
|
description = ''
|
||||||
|
Sets the speed speed of window resizing. The default is given in the example.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.InitialKeyRepeat = mkOption {
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
# Apple menu > System Preferences > Keyboard
|
||||||
|
If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat.
|
||||||
|
For example, the Delete key continues to remove text for as long as you hold it down.
|
||||||
|
|
||||||
|
This sets how long you must hold down the key before it starts repeating.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.KeyRepeat = mkOption {
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
# Apple menu > System Preferences > Keyboard
|
||||||
|
If you press and hold certain keyboard keys when in a text area, the key’s character begins to repeat.
|
||||||
|
For example, the Delete key continues to remove text for as long as you hold it down.
|
||||||
|
|
||||||
|
This sets how fast it repeats once it starts.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to use the expanded print panel by default. The default is false.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint2 = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to use the expanded print panel by default. The default is false.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -133,6 +216,14 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.trackpad.enableSecondaryClick" = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to enable trackpad secondary click. The default is true.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
system.defaults.NSGlobalDomain."com.apple.trackpad.trackpadCornerClickBehavior" = mkOption {
|
system.defaults.NSGlobalDomain."com.apple.trackpad.trackpadCornerClickBehavior" = mkOption {
|
||||||
type = types.nullOr (types.enum [ 1 ]);
|
type = types.nullOr (types.enum [ 1 ]);
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -141,5 +232,31 @@ with lib;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.springing.enabled" = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to enable spring loading (expose) for directories.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.springing.delay" = mkOption {
|
||||||
|
type = types.nullOr float;
|
||||||
|
default = null;
|
||||||
|
example = "1.0";
|
||||||
|
description = ''
|
||||||
|
Set the spring loading delay for directories. The default is given in the example.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = mkOption {
|
||||||
|
type = types.nullOr types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Whether to enable "Natural" scrolling direction. The default is true.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,69 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
system.defaults.NSGlobalDomain.AppleFontSmoothing = 1;
|
||||||
|
system.defaults.NSGlobalDomain.AppleKeyboardUIMode = 3;
|
||||||
|
system.defaults.NSGlobalDomain.ApplePressAndHoldEnabled = true;
|
||||||
|
system.defaults.NSGlobalDomain.AppleShowAllExtensions = true;
|
||||||
|
system.defaults.NSGlobalDomain.AppleShowScrollBars = "Always";
|
||||||
|
system.defaults.NSGlobalDomain.NSAutomaticCapitalizationEnabled = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSAutomaticDashSubstitutionEnabled = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSAutomaticPeriodSubstitutionEnabled = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSAutomaticQuoteSubstitutionEnabled = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSAutomaticSpellingCorrectionEnabled = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSDisableAutomaticTermination = true;
|
||||||
|
system.defaults.NSGlobalDomain.NSDocumentSaveNewDocumentsToCloud = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSNavPanelExpandedStateForSaveMode = true;
|
||||||
|
system.defaults.NSGlobalDomain.NSNavPanelExpandedStateForSaveMode2 = true;
|
||||||
|
system.defaults.NSGlobalDomain.NSTableViewDefaultSizeMode = 2;
|
||||||
|
system.defaults.NSGlobalDomain.NSTextShowsControlCharacters = true;
|
||||||
|
system.defaults.NSGlobalDomain.NSUseAnimatedFocusRing = false;
|
||||||
|
system.defaults.NSGlobalDomain.NSScrollAnimationEnabled = true;
|
||||||
|
system.defaults.NSGlobalDomain.NSWindowResizeTime = "0.01";
|
||||||
|
system.defaults.NSGlobalDomain.InitialKeyRepeat = 10;
|
||||||
system.defaults.NSGlobalDomain.KeyRepeat = 1;
|
system.defaults.NSGlobalDomain.KeyRepeat = 1;
|
||||||
|
system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint = true;
|
||||||
|
system.defaults.NSGlobalDomain.PMPrintingExpandedStateForPrint2 = 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;
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.springing.enabled" = true;
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.springing.delay" = "0.0";
|
||||||
|
system.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = true;
|
||||||
system.defaults.dock.autohide-delay = "0.24";
|
system.defaults.dock.autohide-delay = "0.24";
|
||||||
system.defaults.dock.orientation = "left";
|
system.defaults.dock.orientation = "left";
|
||||||
|
|
||||||
test = ''
|
test = ''
|
||||||
echo checking defaults write in /activate-user >&2
|
echo checking defaults write in /activate-user >&2
|
||||||
|
grep "defaults write -g 'AppleFontSmoothing' -int 1" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'AppleKeyboardUIMode' -int 3" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'ApplePressAndHoldEnabled' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'AppleShowAllExtensions' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'AppleShowScrollBars' -string 'Always'" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSAutomaticCapitalizationEnabled' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSAutomaticDashSubstitutionEnabled' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSAutomaticPeriodSubstitutionEnabled' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSAutomaticQuoteSubstitutionEnabled' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSAutomaticSpellingCorrectionEnabled' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSDisableAutomaticTermination' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSDocumentSaveNewDocumentsToCloud' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSNavPanelExpandedStateForSaveMode' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSNavPanelExpandedStateForSaveMode2' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSTableViewDefaultSizeMode' -int 2" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSTextShowsControlCharacters' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSUseAnimatedFocusRing' -bool NO" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSScrollAnimationEnabled' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'NSWindowResizeTime' -float 0.01" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'InitialKeyRepeat' -int 10" ${config.out}/activate-user
|
||||||
grep "defaults write -g 'KeyRepeat' -int 1" ${config.out}/activate-user
|
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.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
|
||||||
|
grep "defaults write -g 'com.apple.springing.enabled' -bool YES" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'com.apple.springing.delay' -float 0.0" ${config.out}/activate-user
|
||||||
|
grep "defaults write -g 'com.apple.swipescrolldirection' -bool YES" ${config.out}/activate-user
|
||||||
grep "defaults write com.apple.dock 'orientation' -string 'left'" ${config.out}/activate-user
|
grep "defaults write com.apple.dock 'orientation' -string 'left'" ${config.out}/activate-user
|
||||||
grep "defaults write com.apple.dock 'autohide-delay' -float 0.24" ${config.out}/activate-user
|
grep "defaults write com.apple.dock 'autohide-delay' -float 0.24" ${config.out}/activate-user
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue