How to changing TTY keyboard layout?

I’m trying to customize the keyboard RU layout in the console. But it does not work in the terminal (for example tty2,3,4). Works only for X terminal.

xserver = {
  enable = true;
  layout = "us,ru";
  xkbOptions = "caps:swapescape,grp:rctrl_rshift_toggle";
};

Could you specify settings for TTY layout

1 Like

I think that is what the consoleKeyMap option is for:
https://nixos.org/nixos/options.html#i18n.consolekeymap

1 Like

I use i18n.consoleUseXkbConfig (for TTY to use the same settings).

e.g.,

{
  services.xserver.layout = "us,ua";
  services.xserver.xkbVariant = "workman,";

  # Use same config for linux console
  i18n.consoleUseXkbConfig = true;
}
4 Likes

Works for me, Thanks!

For reference: The used option i18n.consoleUseXkbConfig has been renamed to console.useXkbConfig

2 Likes