From ed9dc1f18780621ad5d5498b9cd7caa5c71787b1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 24 Nov 2017 00:25:54 +0100 Subject: [PATCH 1/2] nixos/libinput: load configuration file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order for libinput to be used with Xorg, its configuration file needs to be added to environment similarly to how evdev one’s is. Closes: #31670 --- nixos/modules/services/x11/hardware/libinput.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/x11/hardware/libinput.nix b/nixos/modules/services/x11/hardware/libinput.nix index 44555cb6e2a9..5aecdef812e6 100644 --- a/nixos/modules/services/x11/hardware/libinput.nix +++ b/nixos/modules/services/x11/hardware/libinput.nix @@ -198,6 +198,13 @@ in { environment.systemPackages = [ pkgs.xorg.xf86inputlibinput ]; + environment.etc = [ + (let cfgPath = "X11/xorg.conf.d/40-libinput.conf"; in { + source = pkgs.xorg.xf86inputlibinput.out + "/share/" + cfgPath; + target = cfgPath; + }) + ]; + services.udev.packages = [ pkgs.libinput ]; services.xserver.config = From c177b838dfc3bc9a7744fc8c49fc0833de6c8c40 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 24 Nov 2017 00:51:23 +0100 Subject: [PATCH 2/2] nixos/xserver: let X choose the xkb rules With libinput used for keyboard, base rules produce incorrect keyboard layouts. We are removing the option as recommended in the XKB configuration guide [1] to let X server choose the ruleset. It looks like it chooses evdev rules which seem to work for some reason [1]: https://www.x.org/releases/X11R7.6/doc/xorg-docs/input/XKB-Config.html#id2521360 --- nixos/modules/services/x11/xserver.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 7d544e153e9a..1049f810ad2a 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -700,7 +700,6 @@ in Section "InputClass" Identifier "Keyboard catchall" MatchIsKeyboard "on" - Option "XkbRules" "base" Option "XkbModel" "${cfg.xkbModel}" Option "XkbLayout" "${cfg.layout}" Option "XkbOptions" "${cfg.xkbOptions}"