Input from USB keyboard/mouse not working in X11 plasma user session

I have recently set up nixos on my PC. Keyboard/mouse input works:

  • On the console
  • In the display manager that is running under X
  • In a wayland plasma session

However, it works not if I select “Plasma (X11)” as the session type. Furthermore, this completely blocks the Ctrl-Alt-F combo to access a console; I need to login over ssh and kill the session.

Note that the system is not frozen; when I for example connect a USB drive, the plasma notification pops up just fine.

I am aware that the Plasma/X11 combo is going away eventually, but I would like to use it as long as possible, as it has much better gaming performance.

In my configuration.nix I have:

# Enable the X11 windowing system.
  services.xserver = {
    enable = true;
  };

  services = {
    desktopManager.plasma6 = {
      enable = true;
    };
    displayManager.plasma-login-manager.enable = true;
  };

I tried enabling the libinput service, but that did not help (and that seems to be only for touchscreens, anyway).

I found these errors/warnings in the Xorg.0.log:

[     8.870] (WW) Option "xkb_variant" requires a string value
[     8.890] (WW) Option "xkb_variant" requires a string value
[     8.899] (WW) Option "xkb_variant" requires a string value
[     8.907] (WW) Option "xkb_variant" requires a string value
[     9.045] (WW) Option "xkb_variant" requires a string value
[     9.087] (WW) Option "xkb_variant" requires a string value
[     9.120] (WW) Option "xkb_variant" requires a string value
[     9.150] (WW) Option "xkb_variant" requires a string value
[     9.162] (WW) Option "xkb_variant" requires a string value
[     9.162] (WW) Option "xkb_variant" requires a string value
[     9.322] (WW) Option "xkb_variant" requires a string value
[    21.002] (WW) Option "xkb_variant" requires a string value
[    24.685] (WW) Option "xkb_variant" requires a string value


[     8.969] (EE) libinput: ZSA Technology Labs Ergodox EZ: Failed to set scroll to twofinger
[     9.025] (EE) libinput: ZSA Technology Labs Ergodox EZ: Failed to set scroll to twofinger
[     9.100] (EE) libinput: Logitech MX Vertical: Failed to set scroll to twofinger
[     9.102] (EE) libinput: Logitech MX Vertical: Failed to set scroll to twofinger

So we can see that my keyboard (ZSA) and my mouse (MX) is detected fine (of course, otherwise mouse/keyboard would not work in the login screen).

In the forum and on reddit I could not find anything useful, so if anyone has any idea, I will be grateful.