diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml
index 7cdc5196e0d2..f6f659b02afa 100644
--- a/nixos/doc/manual/configuration/x-windows.xml
+++ b/nixos/doc/manual/configuration/x-windows.xml
@@ -279,6 +279,12 @@ xkb_symbols "media"
= "setxkbmap -keycodes media";
+
+ If you are manually starting the X server, you should set the argument
+ -xkbdir /etc/X11/xkb, otherwise X won't find your layout files.
+ For example with xinit run
+ $ xinit -- -xkbdir /etc/X11/xkb
+
To learn how to write layouts take a look at the XKB
diff --git a/nixos/modules/services/x11/extra-layouts.nix b/nixos/modules/services/x11/extra-layouts.nix
index 5523dd2bf023..1af98a1318bb 100644
--- a/nixos/modules/services/x11/extra-layouts.nix
+++ b/nixos/modules/services/x11/extra-layouts.nix
@@ -158,7 +158,10 @@ in
});
- services.xserver.xkbDir = "${pkgs.xkb_patched}/etc/X11/xkb";
+ services.xserver = {
+ xkbDir = "${pkgs.xkb_patched}/etc/X11/xkb";
+ exportConfiguration = config.services.xserver.displayManager.startx.enable;
+ };
};
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index b581b7e8a4c2..7e081b664b33 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -468,7 +468,7 @@ self: super:
${name}
- <_description>${layout.description}
+ ${layout.description}
${layout.description}
@@ -484,8 +484,8 @@ self: super:
${name}
- <_shortDescription>${name}
- <_description>${layout.description}
+ ${name}
+ ${layout.description}
${concatMapStrings (lang: "${lang}\n") layout.languages}