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?
I’ve had an similar issue when using i3 with an wireless keyboard, every time the keyboard reconnected the layout was reset to default, this wasn’t a problem with Mate or Gnome since those seem to apply the correct layout automatically but for i3 to work this way I had to set the layout using home-manager aswell.
I think the question is, if you ignore your nixos config, and just look at the files that X11 itself reads, is the configuration set?
Looking at the xserver module, that would be in /etc/X11/xorg.conf.d/00-keyboard.conf.
I suspect that the answer will simply be “yes”, though. There’s even validation for this, it’d be very odd if this wasn’t true.
My hunch is that gdm/GNOME have their own keyboard layout handling, since GNOME is very much designed for imperative system configuration, and carries its own configuration interfaces. It’s probably overriding what you’re doing. Have you tried starting an xserver without ever launching anything GNOME-related?
If my hunch is correct and you can verify that, we might be able to tame GNOME from there
The config is indeed correct. I was unable to start x server by itself. If I run startx, I am dropped into an environment where I can see several windows, but can not interact in any way and have to restart the computer.
Then create a ~/.xinitrc file with these contents:
exec xterm
If you use startx on a tty after that (preferably after a reboot, just to rule out any imperative interference), you should just get an xterm window, which should be enough to test if your layout is being respected. Just hover with your cursor above the window while you’re typing
They shouldn’t care - you’re using gnome in an unintended way (by them), and will likely be told to use the imperative config instead, or get the NixOS maintainers to help support your use case