I create a configuration with this option on my laptop and used the same configuration to install my desktop computer (except hardware-configuration.nix). The mouse acceleration under KDE/Plasma is not applied. It did work on the laptop but on the desktop it remains “adaptive”.
This is the xserver section
services.xserver = {
# Enable the X11 windowing system and configure the keymap in X11.
enable = true;
layout = "de";
xkbVariant = "";
# Enable the KDE Plasma Desktop Environment.
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
# Set Wayland as default
displayManager.defaultSession = "plasmawayland";
libinput.mouse.accelProfile = "flat";
};
Also, not sure if this relevant but I have four input devices in this dialog, but only one mouse connected and my keyboard is also neither from Logitech nor Holtek. I don’t understand what is going on here.
How can I debug this and found out why the acceleration profile is not applied?
Soooooo, get this. I’m running Wayland now… I took your advice @tobiasBora and took a look at Wayland logs with journalctl -b|grep -i 'wayland.*]: ' and saw stuff related to Tmux.
The bellow code that launches tmux with tmuxp was in my zsh profile:
# Launch tmux when:
# it's installed,
# not already in a tmux session, and
# in an interactive shell.
if command -v tmux &> /dev/null && [ $(expr "$TERM" : ".*screen") ] && [ -z "$TMUX" ]; then
if command -v tmuxp &> /dev/null; then
exec tmuxp load ~/.config/NixOS/users/reedclanton/home/config/tmuxp/Default.yaml
fi
fi
So I Changed it to only do so when the current session is tty:
# Launch tmux when:
# it's installed,
# current session is a tty,
# not already in a tmux session, and
# in an interactive shell.
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [ $(expr "$TERM" : ".*screen") ] && [ -z "$TMUX" ]; then
if command -v tmuxp &> /dev/null; then
exec tmuxp load ~/.config/NixOS/users/reedclanton/home/config/tmuxp/Default.yaml
fi
fi
and now Wayland works!
Of course, now I’m confused as to why X11 worked…
Edit: To be clear, setting services.xserver.displayManager.defaultSession to plasmawayland or gnome works to force the usage of Wayland. However, after fixing the tmux issue, I don’t need to set that value at all.
I tested it, and services.xserver.displayManager.gdm.wayland does directly determine if X11 or Wayland is used… most of the time. In my case, that didn’t work until I fixed the TMUX issue. I’ve also seen people online say that Wayland won’t be enabled if not supported by hardware.
Anyways, point is, I tested switching that value from true to false and back again, and it did change from Wayland to X11 and back.
$ nix repl
Welcome to Nix 2.13.2. Type :? for help.
nix-repl> :lf /etc/nixos
warning: Git tree '/etc/nixos' is dirty
Added 10 variables.
nix-repl> nixosConfigurations.YOURHOSTNAME.config.services.xserver.displayManager.sessionData.sessionNames
[ "plasma" "plasmawayland" ]
nix-repl> nixosConfigurations.YOURHOSTNAME.config.services.xserver.displayManager.defaultSession
"plasma"
nix-repl> nixosConfigurations.YOURHOSTNAME.config.services.xserver.displayManager.sessionData.autologinSession
"plasma"
Now, it seems that GDM has a way to save previous session (see ShowLastSession in https://www.jirka.org/gdm-documentation/x241.html), but it is not 100% clear to me when it is using the last session and when it is using the default session.
That is correct. The option should really be renamed to waylandEnabled or waylandAllowed.
Disregarding the failover condition (if gnome session uses Wayland and crashes on login, it will retry with gnome-xorg session), GDM will always pre-select the previous session used by the user as stored by AccountsService. But when you explicitly set defaultSession NixOS option, we will override the AccountService value.
That page looks severely outdated. ShowLastSession has been removed in 2007.