Keyboard Layout Customization: Difference between revisions

imported>Infinisil
mNo edit summary
imported>Erikarvstedt
compile the layout to catch errors at build time and to improve x11 startup performance
Line 18: Line 18:
To load this file at the start of the X session, add this to your <code>configuration.nix</code>:
To load this file at the start of the X session, add this to your <code>configuration.nix</code>:


<source lang="nix">services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${/path/to/layout.xkb} $DISPLAY";
<source lang="nix">
let
  compiledLayout = pkgs.runCommand "keyboard-layout" {} ''
    ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./path/to/layout.xkb} $out
  '';
in
  services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY";
</source>
</source>
== Relevant other options ==
== Relevant other options ==