1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 16:57:08 +00:00
nix-darwin/modules/system/defaults/default.nix
2016-12-01 21:34:37 +01:00

37 lines
756 B
Nix

{ 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}
'';
};
}