git.iko.soy/typeable/nixpkgs
on master help sign in
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>

commitd97cdfc591baf790ce5a9836e1503dfb0eb152e6 authoraszlig <aszlig@redmoonstudios.org> dateMon 3 Jul 2017, 07:33 (9 years ago) parent02ce696
1 file changed+4
nixos/modules/services/x11/xserver.nix+4
nixos/modules/services/x11/xserver.nix+4
@@ -652,6 +652,10 @@ in
652652 inherit (cfg) layout xkbDir;
653653 } ''
654654 if sed -n -e ':i /^! \(layout\|variant\) *$/ {
655+ # Loop through all of the layouts/variants until we hit another ! at
656+ # the start of the line or the line is empty ('t' branches only if
657+ # the last substitution was successful, so if the line is empty the
658+ # substition will fail).
655659 :l; n; /^!/bi; s/^ *\([^ ]\+\).*/\1/p; tl
656660 }' "$xkbDir/rules/base.lst" | grep -qxF "$layout"
657661 then