From 066bf467baa3132438e8c8bde58ce3ef34928973 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 19 Jul 2026 11:43:41 -0400 Subject: [PATCH] feat: remap caps lock to escape on every host Sets the xkb layout and `caps:escape_shifted_capslock` in the shared base config, and builds the console keymap from it so the remap applies on a bare TTY rather than only under a graphical session. Shift+Caps Lock still toggles Caps Lock. neogaia's `console.keyMap` is dropped: `console.useXkbConfig` defines that option itself, so the two definitions would conflict. --- hosts/neogaia/default.nix | 1 - system/default.nix | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hosts/neogaia/default.nix b/hosts/neogaia/default.nix index c5eb008..0eb0791 100644 --- a/hosts/neogaia/default.nix +++ b/hosts/neogaia/default.nix @@ -39,5 +39,4 @@ time.timeZone = "America/New_York"; i18n.defaultLocale = "en_GB.UTF-8"; - console.keyMap = "us"; } diff --git a/system/default.nix b/system/default.nix index bda9581..b99cd6e 100644 --- a/system/default.nix +++ b/system/default.nix @@ -58,6 +58,14 @@ in ]; environment.systemPackages = [ pkgs.git ]; + # Caps Lock is a second Escape; Shift+Caps Lock still toggles Caps Lock. + services.xserver.xkb.layout = "us"; + services.xserver.xkb.options = "caps:escape_shifted_capslock"; + + # Compile the console keymap from the layout above, so the remap holds on a + # bare TTY and not only under a graphical session. + console.useXkbConfig = true; + # Primary user, in the wheel group. No password set here. users.users.${user.name} = { isNormalUser = true;