nixpkgs-suyu/pkgs/tools
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
..
admin aws-auth: clean up 2017-07-26 18:45:41 +02:00
archivers unzipNLS : Fix build by removing patch fuzz. 2017-07-09 10:44:48 +02:00
audio ezstream: init at 0.6.0 (#27259) 2017-07-09 16:46:16 +01:00
backup Merge pull request #27616 from jfrankenau/update-borg 2017-07-24 18:44:21 +00:00
bluetooth blueman: wrap binaries in libexec 2017-06-01 14:30:40 +03:00
bootloaders/refind refind: mark as broken 2017-03-14 15:36:35 +01:00
cd-dvd unetbootin: set QT_X11_NO_MITSHM=1 2017-05-20 14:42:32 -04:00
compression upx: fix clang build 2017-07-26 23:24:49 +02:00
filesystems accelio: Remove 2017-07-23 10:47:13 -04:00
graphics gmic: remove myself as maintainer 2017-07-27 22:54:53 +02:00
inputmethods ibus-m17n: fix homepage URL. 2017-05-27 22:39:16 -04:00
misc mimeo: 2017.2.9 -> 2017.6.6 2017-07-27 22:53:55 +02:00
nagstamon nagstamon: init at 2.0.1 2017-06-01 19:32:06 +02:00
networking tinc_pre: avoid infinite loop with EBADFD on network restart 2017-07-27 18:04:33 +02:00
package-management disnix: 0.7.1 -> 0.7.2 2017-07-26 19:22:19 +00:00
security qesteidutil: 3.12.2.1206 -> 3.12.5.1233 2017-07-24 01:13:35 +02:00
system honcho: 0.6.6 -> 1.0.1 2017-07-25 23:22:01 -04:00
text nawk: init at 20121220 2017-07-27 21:51:10 +07:00
typesetting texlive: switch to a *working* temporary mirror 2017-07-11 15:34:05 +02:00
video atomicparsley: 0.9.0 -> 0.9.6 2017-04-14 12:10:28 -07:00
virtualization google-compute-engine: init at 20170523 2017-07-15 18:00:55 +01:00
X11 nixos/xserver: Properly validate XKB options 2017-07-28 12:39:55 +02:00