diff --git a/config.nix b/config.nix index 5a08ead8..42884bec 100644 --- a/config.nix +++ b/config.nix @@ -9,6 +9,7 @@ let [ config ./modules/system ./modules/system/activation-scripts.nix + ./modules/system/defaults ./modules/system/etc.nix ./modules/environment ./modules/launchd @@ -38,15 +39,18 @@ let { serviceConfig.Program = "${pkgs.nix}/bin/nix-daemon"; serviceConfig.KeepAlive = true; serviceConfig.RunAtLoad = true; + serviceConfig.ProcessType = "Background"; + serviceConfig.SoftResourceLimits.NumberOfFiles = 4096; + serviceConfig.EnvironmentVariables.NIX_BUILD_HOOK="/nix/var/nix/profiles/default/libexec/nix/build-remote.pl"; + serviceConfig.EnvironmentVariables.NIX_CURRENT_LOAD="/nix/tmp/current-load"; + serviceConfig.EnvironmentVariables.NIX_REMOTE_SYSTEMS="/etc/nix/machines"; serviceConfig.EnvironmentVariables.SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; serviceConfig.EnvironmentVariables.TMPDIR = "/nix/tmp"; - serviceConfig.EnvironmentVariables.NIX_BUILD_HOOK="/nix/var/nix/profiles/default/libexec/nix/build-remote.pl"; - serviceConfig.EnvironmentVariables.NIX_REMOTE_SYSTEMS="/etc/nix/machines"; - serviceConfig.EnvironmentVariables.NIX_CURRENT_LOAD="/nix/tmp/current-load"; - serviceConfig.SoftResourceLimits.NumberOfFiles = 4096; - serviceConfig.ProcessType = "Background"; }; + system.defaults.global.InitialKeyRepeat = 10; + system.defaults.global.KeyRepeat = 1; + programs.tmux.loginShell = "${pkgs.lnl.zsh}/bin/zsh -l"; programs.tmux.enableSensible = true; programs.tmux.enableMouse = true; @@ -228,12 +232,6 @@ in { set clipboard=unnamed - cmap - imap - nmap - omap - vmap - vmap s S cnoremap %% =expand('%:h') . '/' diff --git a/modules/system/activation-scripts.nix b/modules/system/activation-scripts.nix index f9e6d864..fda882f0 100644 --- a/modules/system/activation-scripts.nix +++ b/modules/system/activation-scripts.nix @@ -54,6 +54,7 @@ in # Prevent the current configuration from being garbage-collected. ln -sfn /run/current-system /nix/var/nix/gcroots/current-system + ${cfg.activationScripts.defaults.text} ${cfg.activationScripts.etc.text} ${cfg.activationScripts.launchd.text} diff --git a/modules/system/defaults/default.nix b/modules/system/defaults/default.nix new file mode 100644 index 00000000..7cfa041b --- /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} + ''; + }; +}