dotfiles/modules/nixos/hardware/keyboard.nix
2023-09-30 10:20:45 -04:00

36 lines
723 B
Nix

{ config, pkgs, ... }: {
config = {
services.xserver = {
layout = "us";
# Keyboard responsiveness
autoRepeatDelay = 250;
autoRepeatInterval = 40;
};
# Use capslock as escape and/or control
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
settings = { main = { capslock = "overload(control, esc)"; }; };
};
};
};
# For some reason, keyd doesn't restart properly when updating
system.activationScripts.keyd.text =
"${pkgs.systemd}/bin/systemctl restart keyd.service";
# Enable num lock on login
home-manager.users.${config.user}.xsession.numlock.enable = true;
};
}