diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 1f4fb05129d4..01bab8fccadb 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -651,10 +651,13 @@ in system.extraDependencies = singleton (pkgs.runCommand "xkb-layouts-exist" { inherit (cfg) layout xkbDir; } '' - set -x - sed -n -e ':i /^! \(layout\|variant\) *$/ { - :l; n; /^!/bi; s/^ *\([^ ]\+\).*/\1/p; tl - }' "$xkbDir/rules/base.lst" | grep -qxF "$layout" && exec touch "$out" + if sed -n -e ':i /^! \(layout\|variant\) *$/ { + :l; n; /^!/bi; s/^ *\([^ ]\+\).*/\1/p; tl + }' "$xkbDir/rules/base.lst" | grep -qxF "$layout" + then + touch "$out" + exit 0 + fi cat >&2 <<-EOF