From b8cbb9fb5be8a096b0002c95ccfeee86ea19b593 Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sun, 1 Dec 2019 21:06:54 +0100 Subject: ws/hardware: setting Thinkpad keyboard to dvorak only --- modules/workstation/hardware/xkblayout/default.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'modules/workstation/hardware') diff --git a/modules/workstation/hardware/xkblayout/default.nix b/modules/workstation/hardware/xkblayout/default.nix index 1fa51cc0527..a77068cfd92 100644 --- a/modules/workstation/hardware/xkblayout/default.nix +++ b/modules/workstation/hardware/xkblayout/default.nix @@ -9,8 +9,24 @@ { i18n.consoleUseXkbConfig = true; - services.xserver.layout = "us"; - # environment.variables.XKB_DEFAULT_LAYOUT = xcfg.layout; - # environment.variables.XKB_DEFAULT_OPTIONS = xcfg.xkbOptions; + services.xserver = { + layout = "us"; + xkbVariant = "altgr-intl"; + xkbOptions = "caps:hyper"; + + # We want to set this layout modification as a per-device setting + # to avoid interpreting hardware keyboards with the same + # layout, which would otherwise lead to "double dvorak". + extraConfig = '' + Section "InputClass" + Identifier "Internal Keyboard" + MatchIsKeyboard "yes" + MatchProduct "AT Translated Set 2 keyboard" + Option "XkbLayout" "dvorak" + Option "XkbVariant" "altgr-intl" + Option "XkbOptions" "caps:hyper" + EndSection + ''; + }; } -- cgit v1.2.3