mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-06 16:57:08 +00:00
37 lines
756 B
Nix
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}
|
|
'';
|
|
};
|
|
}
|