diff options
| author | pjan vandaele <pjan.vandaele@gmail.com> | 2017-12-31 11:44:02 +0900 |
|---|---|---|
| committer | pjan vandaele <pjan.vandaele@gmail.com> | 2017-12-31 12:15:22 +0900 |
| commit | d7e67ce030e6b7ec41f5f3beb011992c698984e2 (patch) | |
| tree | bb4d92579ab82f238f4326067edf7a1cd8abc338 /modules/system/defaults | |
| parent | 6aec3fbb50b3c44af0899858d35fcafeb443ffb9 (diff) | |
float type
Diffstat (limited to 'modules/system/defaults')
| -rw-r--r-- | modules/system/defaults/dock.nix | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/modules/system/defaults/dock.nix b/modules/system/defaults/dock.nix index 1fd97c3..378d703 100644 --- a/modules/system/defaults/dock.nix +++ b/modules/system/defaults/dock.nix @@ -2,7 +2,17 @@ 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 = { system.defaults.dock.autohide = mkOption { @@ -14,24 +24,18 @@ with lib; }; system.defaults.dock.autohide-delay = mkOption { - type = types.nullOr types.attrs; + type = types.nullOr float; default = null; - example = { - type = "float"; - value = "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 types.attrs; + type = types.nullOr float; default = null; - example = { - type = "float"; - value = "1.0"; - }; + example = "1.0"; description = '' Sets the speed of the animation when hiding/showing the Dock. The default is given in the example. ''; @@ -54,12 +58,9 @@ with lib; }; system.defaults.dock.expose-animation-duration = mkOption { - type = types.nullOr types.attrs; + type = types.nullOr float; default = null; - example = { - type = "float"; - value = "1.0"; - }; + example = "1.0"; description = '' Sets the speed of the Mission Control animations. The default is given in the example. ''; |
