From 6aec3fbb50b3c44af0899858d35fcafeb443ffb9 Mon Sep 17 00:00:00 2001 From: pjan vandaele Date: Thu, 28 Dec 2017 09:55:31 +0900 Subject: [PATCH] Adds attrs type for defaults. Adds additional Dock settings. --- .gitignore | 1 + modules/system/defaults-write.nix | 1 + modules/system/defaults/dock.nix | 118 +++++++++++++++++++++++++++--- 3 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1377554e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/modules/system/defaults-write.nix b/modules/system/defaults-write.nix index 7a5eba49..cf0a10a3 100644 --- a/modules/system/defaults-write.nix +++ b/modules/system/defaults-write.nix @@ -12,6 +12,7 @@ let if isBool value then "-bool ${boolValue value}" else if isInt value then "-int ${toString value}" else if isString value then "-string '${value}'" else + if isAttrs value then "-${value.type} '${value.value}'" else throw "invalid value type"; writeDefault = domain: key: value: diff --git a/modules/system/defaults/dock.nix b/modules/system/defaults/dock.nix index 5795bcd2..1fd97c3d 100644 --- a/modules/system/defaults/dock.nix +++ b/modules/system/defaults/dock.nix @@ -13,27 +13,79 @@ with lib; ''; }; - system.defaults.dock.orientation = mkOption { - type = types.nullOr (types.enum [ "bottom" "left" "right" ]); + system.defaults.dock.autohide-delay = mkOption { + type = types.nullOr types.attrs; default = null; + example = { + type = "float"; + value = "0.24"; + }; description = '' - Position of the dock on screen. The default is "bottom". + Sets the speed of the autohide delay. The default is given in the example. ''; }; - system.defaults.dock.showhidden = mkOption { + system.defaults.dock.autohide-time-modifier = mkOption { + type = types.nullOr types.attrs; + default = null; + example = { + type = "float"; + value = "1.0"; + }; + description = '' + Sets the speed of the animation when hiding/showing the Dock. The default is given in the example. + ''; + }; + + system.defaults.dock.dashboard-in-overlay = mkOption { type = types.nullOr types.bool; default = null; description = '' - Whether to make icons of hidden applications tranclucent. The default is false. + Whether to hide Dashboard as a Space. The default is false; ''; }; - system.defaults.dock.tilesize = mkOption { - type = types.nullOr types.int; + system.defaults.dock.enable-spring-load-actions-on-all-items = mkOption { + type = types.nullOr types.bool; default = null; description = '' - Size of the icons in the dock. The default is 64. + Enable spring loading for all Dock items. The default is false; + ''; + }; + + system.defaults.dock.expose-animation-duration = mkOption { + type = types.nullOr types.attrs; + default = null; + example = { + type = "float"; + value = "1.0"; + }; + description = '' + Sets the speed of the Mission Control animations. The default is given in the example. + ''; + }; + + system.defaults.dock.expose-group-by-app = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Whether to group windows by application in Mission Control's Exposé. The default is true. + ''; + }; + + system.defaults.dock.launchanim = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Animate opening applications from the Dock. The default is true. + ''; + }; + + system.defaults.dock.mineffect = mkOption { + type = types.nullOr (types.enum [ "genie" "suck" "scale" ]); + default = null; + description = '' + Set the minimize/maximize window effect. The default is genie. ''; }; @@ -45,6 +97,14 @@ with lib; ''; }; + system.defaults.dock.mouse-over-hilite-stack = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Enable highlight hover effect for the grid view of a stack in the Dock. + ''; + }; + system.defaults.dock.mru-spaces = mkOption { type = types.nullOr types.bool; default = null; @@ -53,5 +113,45 @@ with lib; ''; }; - }; + system.defaults.dock.orientation = mkOption { + type = types.nullOr (types.enum [ "bottom" "left" "right" ]); + default = null; + description = '' + Position of the dock on screen. The default is "bottom". + ''; + }; + + system.defaults.dock.show-process-indicators = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Show indicator lights for open applications in the Dock. The default is true. + ''; + }; + + system.defaults.dock.showhidden = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Whether to make icons of hidden applications tranclucent. The default is false. + ''; + }; + + system.defaults.dock.static-only = mkOption { + type = types.nullOr types.bool; + default = null; + description = '' + Show only open applications in the Dock. The default is false. + ''; + }; + + system.defaults.dock.tilesize = mkOption { + type = types.nullOr types.int; + default = null; + description = '' + Size of the icons in the dock. The default is 64. + ''; + }; + + }; }