3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/services
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/salt salt-minion: link to configuration documentation 2017-05-11 07:12:04 +01:00
amqp
audio Merge pull request #27000 from Balletie/fix/pulseaudio-alsa-conf 2017-07-17 08:20:38 +02:00
backup znapzend service: options for logging/nodestroy/restart on failure 2017-05-22 21:47:51 +01:00
cluster lib: introduce imap0, imap1 (#25543) 2017-07-04 23:29:23 +01:00
computing slurm: 15-08-5-1 -> 17.02.6, slurm-llnl -> slurm 2017-07-13 03:13:05 -04:00
continuous-integration gitlab-runner service: support graceful termination (#27222) 2017-07-11 15:38:46 +01:00
databases mongodb: we already set quiet in config 2017-07-27 13:26:36 +01:00
desktops gnome-disks: add D-Bus service 2017-05-06 19:40:37 +02:00
development
editors Merge pull request #22508 from matthewbauer/remove-emacs24macport 2017-03-18 22:19:20 +01:00
games Factorio service: fix typo in attribute path 2017-07-20 20:32:25 +02:00
hardware Merge pull request #21227 from lheckemann/vgaswitcheroo 2017-04-28 12:47:00 +01:00
logging journalwatch & journalwatch service: init at 1.1.0 2017-07-16 00:14:19 +02:00
mail postfix: complete remake of postfix service (#27276) 2017-07-14 16:55:53 +02:00
misc Merge pull request #26761 from gnidorah/master3 2017-07-26 22:44:45 +08:00
monitoring Merge pull request #27347 from cstrahan/osquery-new 2017-07-24 21:51:10 -04:00
network-filesystems nixos/tahoe: fixup create-introducer, syntax regression from 90acbe5, improperly patched in 72f85b9e07 2017-07-26 19:13:21 -04:00
networking tinc_pre: avoid infinite loop with EBADFD on network restart 2017-07-27 18:04:33 +02:00
printing Merge pull request #27031 from jerith666/cnijfilter-2-80 2017-07-18 14:37:32 +02:00
scheduling fcron: install systab 2017-04-23 11:44:04 +02:00
search ELK: update kibana and the elastic beats to 5.4 (#26252) 2017-06-13 22:36:08 +02:00
security nixos/oauth2_proxy: actually pass provider-specific options 2017-07-21 00:27:06 +02:00
system Merge pull request #26419 from roblabla/feature-sasl 2017-07-20 20:23:52 +02:00
torrent treewide: use boolToString function 2017-04-11 18:18:53 +02:00
ttys kmscon service: disable systemd-vconsole-setup 2017-03-01 13:47:34 +03:00
web-apps piwik & piwik service: init at 3.0.4 2017-06-19 16:00:17 +02:00
web-servers nginx: add gzip_vary to recommended settings 2017-07-17 20:15:59 +02:00
x11 nixos/xserver: Properly validate XKB options 2017-07-28 12:39:55 +02:00