nixpkgs/pkgs/tools/X11
aszlig 6e5d2f8963
nixos/xserver: Properly validate XKB options
Checking the keyboard layout has been a long set of hurdles so far, with
several attempts. Originally, the checking was introduced by @lheckemann
in #23709.

The initial implementation just was trying to check whether the symbols/
directory contained the layout name.

Unfortunately, that wasn't enough and keyboard variants weren't
recognized, so if you set layout to eg. "dvorak" it will fail with an
error (#25526).

So my improvement on that was to use sed to filter rules/base.lst and
match the layout against that. I fucked up twice with this, first
because layout can be a comma-separated list which I didn't account for
and second because I ran into a Nix issue (NixOS/nix#1426).

After fixing this, it still wasn't enough (and this is btw. what
localectl also does), because we were *only* matching rules but not
symbols, so using "eu" as a layout won't work either.

I decided now it's the time to actually use libxkbcommon to try
compiling the keyboard options and see whether it succeeds. This comes
in the form of a helper tool called xkbvalidate.

IMHO this approach is a lot less error-prone and we can be sure that we
don't forget about anything because that's what the X server itself uses
to compile the keymap.

Another advantage of this is that we now validate the full set of XKB
options rather than just the layout.

Tested this against a variety of wrong and correct keyboard
configurations and against the "keymap" NixOS VM tests.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @lheckemann, @peti, @7c6f434c, @tohl, @vcunat, @lluchs
Fixes: #27597
2017-07-28 12:39:55 +02:00
..
arandr arandr: use python2 2016-11-24 22:28:02 +01:00
autocutsel Turn some license strings into lib.licenses values 2014-07-28 11:31:14 +02:00
bgs bgs: update from 0.7.1 to 0.8 2015-09-05 11:20:28 +02:00
bumblebee linuxPackages.nvidia_x11: refactor, build more from source 2017-02-08 16:57:46 +03:00
ckbcomp Fix lots of fetchgit hashes (fallout from #15469) 2016-06-03 17:17:08 +03:00
dex dex: init at 0.7 2015-10-15 13:58:52 +02:00
dispad dispad: init at 0.3.1 2016-02-18 17:14:17 +00:00
dragon-drop treewide: Add lots of meta.platforms 2016-08-02 21:42:43 +03:00
ffcast ffcast: remove unnecessary DESTDIR=$out 2017-03-03 12:58:43 +01:00
go-sct buildGoPackage: deps.json -> deps.nix in NIXON 2016-09-16 00:04:55 +01:00
hsetroot hsetroot: fix libX11 error 2015-02-20 20:49:33 -05:00
keynav keynav: 0.20110708.0 -> 0.20150730.0 2015-09-13 08:16:42 +02:00
ksuperkey Fix lots of fetchgit hashes (fallout from #15469) 2016-06-03 17:17:08 +03:00
nitrogen nitrogen: 1.6.0 -> 1.6.1 2017-02-20 21:44:56 -05:00
numlockx numlockx: init at 1.2 2015-10-16 20:19:19 +03:00
obconf obconf: add libSM to fix build 2017-02-26 20:11:25 +01:00
oblogout oblogout: init at 2009-11-18 2016-10-23 11:45:30 +02:00
primus primus: fix if nvidia is not used 2017-03-08 23:10:43 +03:00
ratmen A comment about the license 2015-06-14 23:26:58 +03:00
runningx runningx: fix darwin build 2016-08-16 19:25:45 +00:00
screen-message screen-message: 0.24 -> 0.25 2017-06-20 03:45:39 +02:00
sct sct: Updated sha256 in default.nix (#17163) 2016-07-28 09:21:21 +02:00
setroot setroot: 1.4.4 -> 2.0.1 2017-07-24 05:38:06 +10:00
skippy-xd Fix lots of fetchgit hashes (fallout from #15469) 2016-06-03 17:17:08 +03:00
sselp Fix user-facing typos (mainly in descriptions) 2014-12-30 03:31:03 +01:00
vdpauinfo xlibs: replace occurrences by xorg 2015-09-15 12:54:34 +02:00
virtualgl virtualglLib: 2.5.1 -> 2.5.2 2017-07-27 17:07:45 +03:00
wayv wayv: install docs 2017-03-18 12:41:09 +01:00
winswitch Do not use top-level buildPythonPackage or buildPythonApplication 2016-09-26 11:10:51 +02:00
wmctrl Fix many package descriptions 2014-08-24 22:31:37 +02:00
wmutils-core wmutils-core: 1.0 -> 1.1 2015-09-29 12:25:38 +02:00
wmutils-opt wmutils-opt: init at v1.0 2017-01-30 20:42:16 +00:00
x2vnc x2vnc: disable format hardening 2016-08-05 18:09:35 +00:00
x2x x2x: disable format hardening 2016-08-04 11:05:29 +02:00
x11vnc Getting rid of the var indirection and using a bin path instead 2017-01-29 04:11:01 -06:00
xannotate xannotate: init at 20150301 2017-03-18 12:41:09 +01:00
xautomation xautomation: init at 1.09 2017-07-12 14:13:10 +08:00
xbanish xbanish: init at 1.4 👻 2016-04-19 23:33:38 -07:00
xbindkeys guile rev-deps: fix build by adding pkgconfig 2017-02-18 08:23:07 +01:00
xbindkeys-config Use general hardening flag toggle lists 2016-03-05 18:55:26 +01:00
xbrightness treewide: Add lots of meta.platforms 2016-08-02 21:42:43 +03:00
xcalib
xcape xcape: git-2015-03-01 -> 1.2 2016-11-23 07:30:00 -02:00
xchainkeys xchainkeys: fix source and homepage url 2017-01-26 03:52:50 +01:00
xcwd xcwd: init at 2016-09-30 2017-07-13 13:56:22 +01:00
xdg-user-dirs
xdg-utils fix #25511 2017-06-05 23:37:53 +00:00
xdotool xdotool: 3.20150503.1 -> 3.20160805.1 2016-11-08 05:24:06 +08:00
xgeometry-select xgeometry-select: remove license field. license is unknown. 2016-06-07 17:56:01 +01:00
xinput_calibrator treewide: Add lots of meta.platforms 2016-08-02 21:42:43 +03:00
xkb-switch xkb-switch: Update 2015-01-04 02:48:05 +03:00
xkbset xkbset: init at 0.5 2017-04-02 02:17:30 +03:00
xkbvalidate nixos/xserver: Properly validate XKB options 2017-07-28 12:39:55 +02:00
xmacro treewide: Add lots of platforms to packages with no meta 2016-08-02 21:17:44 +03:00
xmagnify xmagnify: init at 0.1.0 (#17222) (#17222) 2016-07-25 06:00:27 +02:00
xnee treewide: explicitly specify gtk and related package versions 2016-09-12 18:26:06 +03:00
xpra xpra: fix missed ffmpeg_3_2 reference 2017-04-30 16:58:33 -07:00
xprintidle-ng xprintidel-ng: init at git-2015-09-01 2015-12-12 11:47:18 +01:00
xrectsel xrectsel: remove unnecessary DESTDIR=$out 2017-03-03 12:59:54 +01:00
xrestop treewide: Add lots of platforms to packages with no meta 2016-08-02 21:17:44 +03:00
xsettingsd xsettingsd: 0.0.1 -> git-2015-06-14 2016-03-03 11:58:55 -03:00
xtrace Fix lots of fetchgit hashes (fallout from #15469) 2016-06-03 17:17:08 +03:00
xvkbd xvkbd: 3.7 -> 3.8 2017-07-11 22:44:44 +02:00
xwinmosaic Fix lots of fetchgit hashes (fallout from #15469) 2016-06-03 17:17:08 +03:00