diff options
| author | Malo Bourgon <mbourgon@gmail.com> | 2022-08-29 15:39:16 -0700 |
|---|---|---|
| committer | Malo Bourgon <mbourgon@gmail.com> | 2022-08-29 15:39:16 -0700 |
| commit | 5fa362c32f7a20ee1fb4baf7f23dc5128da6affe (patch) | |
| tree | fc666fb6e991a661b2e955c1454f7c53c74ecbbe /modules/system/defaults | |
| parent | 157a3c3c4ea482317a4eb4ea2c41db4f16c82420 (diff) | |
Transition to using native floats
Diffstat (limited to 'modules/system/defaults')
| -rw-r--r-- | modules/system/defaults/NSGlobalDomain.nix | 25 | ||||
| -rw-r--r-- | modules/system/defaults/dock.nix | 23 |
2 files changed, 18 insertions, 30 deletions
diff --git a/modules/system/defaults/NSGlobalDomain.nix b/modules/system/defaults/NSGlobalDomain.nix index 023c06c..49a2a86 100644 --- a/modules/system/defaults/NSGlobalDomain.nix +++ b/modules/system/defaults/NSGlobalDomain.nix @@ -3,15 +3,8 @@ 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; - }; - + # Should only be used with options that previously used floats defined as strings. + inherit (config.lib.defaults.types) floatWithDeprecationError; in { options = { @@ -208,9 +201,9 @@ in { }; system.defaults.NSGlobalDomain.NSWindowResizeTime = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; - example = "0.20"; + example = 0.20; description = '' Sets the speed speed of window resizing. The default is given in the example. ''; @@ -273,14 +266,16 @@ in { }; system.defaults.NSGlobalDomain."com.apple.sound.beep.volume" = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; description = '' # Apple menu > System Preferences > Sound Sets the beep/alert volume level from 0.000 (muted) to 1.000 (100% volume). 75% = 0.7788008 + 50% = 0.6065307 + 25% = 0.4723665 ''; }; @@ -312,7 +307,7 @@ in { }; system.defaults.NSGlobalDomain."com.apple.trackpad.scaling" = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; description = '' Configures the trackpad tracking speed (0 to 3). The default is "1". @@ -328,9 +323,9 @@ in { }; system.defaults.NSGlobalDomain."com.apple.springing.delay" = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; - example = "1.0"; + example = 1.0; description = '' Set the spring loading delay for directories. The default is given in the example. ''; diff --git a/modules/system/defaults/dock.nix b/modules/system/defaults/dock.nix index 3156e90..ba62e7a 100644 --- a/modules/system/defaults/dock.nix +++ b/modules/system/defaults/dock.nix @@ -3,15 +3,8 @@ 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; - }; - + # Should only be used with options that previously used floats defined as strings. + inherit (config.lib.defaults.types) floatWithDeprecationError; in { options = { @@ -32,18 +25,18 @@ in { }; system.defaults.dock.autohide-delay = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; - example = "0.24"; + example = 0.24; description = '' Sets the speed of the autohide delay. The default is given in the example. ''; }; system.defaults.dock.autohide-time-modifier = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; - example = "1.0"; + example = 1.0; description = '' Sets the speed of the animation when hiding/showing the Dock. The default is given in the example. ''; @@ -66,9 +59,9 @@ in { }; system.defaults.dock.expose-animation-duration = mkOption { - type = types.nullOr float; + type = types.nullOr floatWithDeprecationError; default = null; - example = "1.0"; + example = 1.0; description = '' Sets the speed of the Mission Control animations. The default is given in the example. ''; |
