Talk:Keyboard Layout Customization
Key symbols reference broken
xorg.xproto
seems not to exist anymore, so the command with nix-build --no-out-link '<nixpkgs>' -A xorg.xproto
does not work anymore. Whats the correct replacement? --Itium (talk) 23:21, 9 January 2023 (UTC)
Incomplete application of the keyboard layout across environments
The current page shows decent basic and advanced configuration, but it does not apply the desired keyboard layout consistently across all environments. I only use a basic keyboard configuration, so I cannot speak for the Advanced part; However, I can do so for the simple configuration.
For example, if one adds the following to their configuration.nix
:
services.xserver.xkb = {
layout = "fr";
variant = "";
};
The keyboard layout is applied in most X11 environments, but not in the Linux Console (TTY) and not in certain Wayland compositors.
The solution to this seems pretty simple to me:
- Add the
console.useXkbConfig = true;
option. - Export
XKB_DEFAULT_
* variables withenvironment.variables = {};
, for example:
environment.variables = {
XKB_DEFAULT_LAYOUT = config.services.xserver.xkb.layout;
XKB_DEFAULT_VARIANT = config.services.xserver.xkb.variant;
}
In my experience, this allows the Linux Console to use the keyboard settings set with services.xserver.xkb
, and allows "misbehaving" Wayland compositors to do the same.
For example, this is my current /etc/nixos/input/keyboard-layout.nix
module:
On another note, there is the following line in this page:
«You can find valid values for these options in $(nix-build --no-out-link '<nixpkgs>' -A xkeyboard_config)/etc/X11/xkb/rules/base.lst
», but this is incomplete, and also simply does not work. Removing this or fixing this would be great, though, I do not know how to do the latter.