From e57c0f3bf9625d0cf6f4b0c3cf65aa086d3f8a50 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 8 Sep 2019 14:51:23 +0200 Subject: [PATCH 1/3] nixos/xserver: export configuration with startx and extra layouts If the X server is run manually it must be started with an `-xkbdir` argument pointing to the custom xkb directory. So we export it to /etc/X11/xkb. --- nixos/modules/services/x11/extra-layouts.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/extra-layouts.nix b/nixos/modules/services/x11/extra-layouts.nix index 5523dd2bf02..1af98a1318b 100644 --- a/nixos/modules/services/x11/extra-layouts.nix +++ b/nixos/modules/services/x11/extra-layouts.nix @@ -158,7 +158,10 @@ in }); - services.xserver.xkbDir = "${pkgs.xkb_patched}/etc/X11/xkb"; + services.xserver = { + xkbDir = "${pkgs.xkb_patched}/etc/X11/xkb"; + exportConfiguration = config.services.xserver.displayManager.startx.enable; + }; }; From 7468809e72366376db73b821c8f4439738a04c37 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 8 Sep 2019 14:57:52 +0200 Subject: [PATCH 2/3] nixos/doc: inform users of startx about `-xkbdir` argument needed --- nixos/doc/manual/configuration/x-windows.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml index 7cdc5196e0d..f6f659b02af 100644 --- a/nixos/doc/manual/configuration/x-windows.xml +++ b/nixos/doc/manual/configuration/x-windows.xml @@ -279,6 +279,12 @@ xkb_symbols "media" = "setxkbmap -keycodes media"; + + If you are manually starting the X server, you should set the argument + -xkbdir /etc/X11/xkb, otherwise X won't find your layout files. + For example with xinit run + $ xinit -- -xkbdir /etc/X11/xkb + To learn how to write layouts take a look at the XKB From e2fca8b1db9b861c7d877aac2631f734030b1f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C8=98erb=C4=83nescu?= Date: Sun, 18 Aug 2019 15:03:38 +0200 Subject: [PATCH 3/3] nixos/xserver: refactor/fix xml tags for keyboard layout overrides With the current XML tags there is an issue when building with a custom keyboard. The description of the new keyboard layout will be missing in the built file: xkeyboard-config-2.27/share/X11/xkb/rules/evdev.lst --- pkgs/servers/x11/xorg/overrides.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index b581b7e8a4c..7e081b664b3 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -468,7 +468,7 @@ self: super: ${name} - <_description>${layout.description} + ${layout.description} ${layout.description} @@ -484,8 +484,8 @@ self: super: ${name} - <_shortDescription>${name} - <_description>${layout.description} + ${name} + ${layout.description} ${concatMapStrings (lang: "${lang}\n") layout.languages}