summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/x11/xserver.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index 01bab8fccadb..504a6b79d577 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -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