I am using greetd as my login manager, and I would like to configure different desktop sessions to launch the same compositor (sway), but with different flags/envvars:
Session A: Sway with iGPU
Session B: Sway with dedicated NVIDIA GPU (--unsupported-gpu flag).
Session files are normally located in /usr/share/sessions or usr/share/wayland-sessions, and in NixOS are properly generated upon enabling the desired desktop environment module.
On any other Linux distro, I’d simply create a file in /usr/share/wayland-sessions/ with something like:
Which partially has the effect I want: I now see 2 session entries in tuigreet. The first one (sway-igpu, default session) works fine, whereas upon launching the the other one (sway-nvidia) I get the following error:
The main issue is that the nixos module for the display managers is tied to the xserver, it hasn’t really been designed with wayland in mind. I don’t know all of the details so you would have to dig in there. The nixpkgs sway package has a share/wayland-sessions/sway.desktop, the issue is to patch the GDM3 / SDDM config for it to look in the right place.
Is the above true, and hence I am hopeless in achieving this?