Dvorak layout disappeared in 23.11

I’ve had this in a NixOS config since 2019:

  services.xserver.layout     = "dvorak, gb, ch";
  services.xserver.xkbVariant = "      ,   , fr";

Trying to upgrade to 23.11, I get the error

The value `dvorak, gb, ch' for keyboard layout is invalid.

Please check the definition in `services.xserver.xkb.layout'.

Removing everything up to and including the first comma, in both entries, gets around the immediate problem, by eliminating the preferred layout.

Looking at the definition of services.xserver.xkb.layout doesn’t lead me to enligtenment.

How can I get the dvorak layout in 23.11?

Seems like now you need to use the layout us and the dvorak variant Dvorak keyboard layout disappeared from NixOS/Xorg · Issue #25526 · NixOS/nixpkgs · GitHub like in

services.xserver.xkb.layout = "us";
services.xserver.xkb.xkbVariant = "dvorak";

In the past it was possible to use setxkbdmap dvorak .... This no longer works.

There seems to be no local man page [edit: yes there is; I must have been mistyping]; tldr doesn’t know anything; zsh-completion seems to be giving me plausible suggestions, but they do not contain anything resembling ‘dvorak’.

How can setxkbdmap be used to switch to a Dvorak layout in NixOS 23.11?

OK, now that I’ve found the man pages, the one for xkeyboard-config leads me to

setxkbmap 'us(dvorak)' ... 

which seems to be working (in my configuration of zsh).

No computer with me to test, but for bepo I run setxkbmap fr bepo, so I would expect setxkbmap us dvorak to work here.

1 Like

Interesting - services.xserver.xkb.layout’s documentation mentions that it can be a comma separated list, but the documentation of services.xserver.xkb.variant doesn’t mention anything about commas, nor does it say that if you do supply a comma-separated list, that it will be matched up with an expected comma separated list in the layout option. But it does seem to work, so thanks for that :slight_smile: