nixos/xserver: Document the layouts sed expression

This was brought up by @0xABAB in #26984 by the following comment:

https://github.com/NixOS/nixpkgs/pull/26984#discussion_r125146405

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2017-07-03 07:33:35 +02:00
parent 02ce696304
commit d97cdfc591
No known key found for this signature in database
GPG Key ID: 1DE8E48E57DB5436

@ -652,6 +652,10 @@ in
inherit (cfg) layout xkbDir;
} ''
if sed -n -e ':i /^! \(layout\|variant\) *$/ {
# Loop through all of the layouts/variants until we hit another ! at
# the start of the line or the line is empty ('t' branches only if
# the last substitution was successful, so if the line is empty the
# substition will fail).
:l; n; /^!/bi; s/^ *\([^ ]\+\).*/\1/p; tl
}' "$xkbDir/rules/base.lst" | grep -qxF "$layout"
then