The keyboard layout does not change after modifying config

When I run setxkbmap -layout cz -variant coder the layout changes to the correct one.

I tried to change to this layout permanently by adding the following to the configuration.nix:

  # Enable the X11 windowing system.
  services.xserver = {
      enable = true;
      layout = "cz";
      xkbVariant = "coder";
      displayManager.gdm.enable = true;
      desktopManager.gnome.enable = true;  
  };

But after every reboot, it switches back to the US layout. Any ideas?

It’s seems like you forgot to run nixos-rebuild switch since writing your config file doesn’t apply the changes automatically

I did sudo nixos-rebuild switch. There is still the old keyboard layout.

I have the same issue when I generate a custom iso. When I boot the layout is always set to “us” no matter what I put in the config I generate the iso from. The other settings of the config are transfered correctly. Did you find a solution?

Hosted by Flying Circus.