summaryrefslogtreecommitdiff
path: root/modules/system/defaults
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2016-12-01 21:34:37 +0100
committerDaiderd Jordan <daiderd@gmail.com>2016-12-01 21:34:37 +0100
commitd82c472ab00f69e17423c7c97bbdec11d87eadd0 (patch)
tree87e07ee6aaa12358d053d441c372c900bcf6ec17 /modules/system/defaults
parent5f7381fb7bb36b897647e0e0f8346d730fa0fb7b (diff)
add initial support for system defaults
Diffstat (limited to 'modules/system/defaults')
-rw-r--r--modules/system/defaults/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/system/defaults/default.nix b/modules/system/defaults/default.nix
new file mode 100644
index 0000000..7cfa041
--- /dev/null
+++ b/modules/system/defaults/default.nix
@@ -0,0 +1,37 @@
+{ config, lib, ... }:
+
+with lib;
+
+let
+
+ cfg = config.system.defaults;
+
+in
+
+{
+ options = {
+
+ system.defaults.global.InitialKeyRepeat = mkOption {
+ type = types.nullOr types.int;
+ default = null;
+ };
+
+ system.defaults.global.KeyRepeat = mkOption {
+ type = types.nullOr types.int;
+ default = null;
+ };
+
+ };
+
+ config = {
+ system.activationScripts.defaults.text = ''
+ # Set defaults
+ echo "writing defaults..." >&2
+
+ '' + optionalString (cfg.global.InitialKeyRepeat != null) ''
+ defaults write -g InitialKeyRepeat -int ${toString cfg.global.InitialKeyRepeat}
+ '' + optionalString (cfg.global.KeyRepeat != null) ''
+ defaults write -g KeyRepeat -int ${toString cfg.global.KeyRepeat}
+ '';
+ };
+}