Plasma Login Manager - Are there alternatives to `services.xserver`?

I am using Plasma Login Manager through the NixOS option services.displayManager.plasma-login-manager.enable = true;

However, to make it so it uses an AZERTY (instead of the QWERTY default) keyboard layout when no users are logged out, I have to set services.xserver.xkb.layout = "fr";

I found no option in i18n that might be respected by Plasma Login Manager, nor in services.displayManager.plasma-login-manager.settings

Since I’m not using X.Org/X 11 and login in a Plasma (Wayland) desktop environment;
I wonder why it is a requirement to use services.xserver for some settings, and if there are any Wayland-native alternatives for it?

If I understand it correctly libxkbcommon is just a seperate library used by wayland compositors and applications to handle keyboard input. So configuring that isn’t nessecarily using the xserver, it’s just that the option is namespaced under services.xserver. You can verify by setting system.forbiddenDependenciesRegexes = [ "^xorg-server" ];, which will cause a failure if your system closure contains the xserver in any way…

2 Likes

This is getting asked a lot.

You’re already using the “Wayland-native” solution. Wayland just took the whole X Keyboard extension (XKB) and included it into the standard. This is what handles keyboard layouts in X.org (it’s very complex and it’s one of the pieces that I would have left behind, honestly).

However, by using that option, you’re not depending on the whole X.org: basically it just pulls in the xkeyboard-config package (it contains the builtin layouts, mapping between keycodes and symbols, geometry of various keyboards, etc.) and libxkbcommon (but that’s probably already linked into the compositor).

2 Likes

Okay, thanks for your quick answers both of you!

1 Like