Open Artturin opened 2 years ago
I've been thinking about this as I consolidate my setup under Wayland. Maybe we need a new top-level option. What comes to mind for me is session
. Here are a few options that could live there:
session.graphical.enable
: Whether or not graphical sessions (like Wayland or xserver) are enabled.session.graphical.desktopManager
, session.graphical.windowManager
, which used to live under services.xserver
.session.graphical.xserver
: remainder of services.xserver
session.displayManager
: Move services.xserver.displayManager
options here since DMs can generally support xserver, wayland, or terminal sessions. Then, for example, greetd can live under session.displayManager.greetd
instead of services.greetd
and can be mutually exclusive with LightDM, SDDM, etc.Duplicate of #102542
i would like to work on this @jtojnar any opinions about the naming suggested by @loafofpiecrust i think its okay
Not sure if we need a new top-level module, rather than just using services
as suggested in https://github.com/NixOS/nixpkgs/issues/102542. Also session evokes to me the user session after logging in. But agree that leaving services.xserver
is desirable.
from #102542
adding the services.displayServer namespace which would include xorg and wayland, so that services.displayServer.wayland.enable = true; would enable all required services that need to be enabled in order to make wayland work for example
wayland isn't a display service but a protocol
Right, but you cannot use the protocol directly – you need a compositor – and that will be a service or a program.
how about
modules/services/graphical
which would at least have a option that indicates that a gui is enabled, which will solve https://github.com/NixOS/nixpkgs/issues/139546
modules/services/wayland/
where we would move the current wayland gui's like modules/programs/sway.nix
and keep modules/services/xserver
Also what should be done with kde and plasma which work in wayland and xorg
Fantastic @Artturin!
@jtojnar We could use top-level services
, but I personally think it's very helpful to logically group these related services together into session.graphical
or similar. I understand session
evoking "after logging in" but the desktop manager is what controls the session and the display manager is also what starts sessions, so it's directly related.
I like having the distinction between services
and session
because sessions like Gnome tend to produce sessions/*.desktop
files, act differently than other services, and are often mutually exclusive at runtime (I can't run both Gnome and KDE at once).
I think that my proposed grouping lends itself well to KDE and Gnome which have both wayland and X variants. I might prefer something more generic than desktopManager
and windowManager
etc (unless those distinctions are useful to others), instead something that encompasses that this is just the top-level program for a user session. Maybe sessions
.
Examples: session.graphical.sessions.plasma5
, session.graphical.sessions.gnome
, along with wayland-only sway at session.graphical.sessions.sway
or x11-only i3 at session.graphical.sessions.i3
. ~I could live with services.graphical.*
as well, but I don't know of any services grouped that way. My understanding is that services
should be flat and if we need hierarchy beyond individual services then we resort to a different config attribute.~ (Edit: misread the services.graphical
bit, we could use session.graphical.enable
too)
Along with that, we could continue to have services.xserver
with a reduced definition, and if you write something like session.graphical.sessions.i3.enable = true;
then that causes services.xserver.enable = true;
. @Artturin The thing with services.wayland
is that wayland isn't a service at all, while xserver is. So it would be confusing to me to put that under services
.
FYI there is no such thing as a desktop manager Only display managers such as lightdm Kde and such are desktop environments
Well, I guess I agree with you. I just picked up the term from the existing NixOS options services.xserver.desktopManager.*
. I find these "desktop manager" / "desktop environment" / "window manager" / "compositor" terminologies unhelpful when we are really talking about whatever program is launched by a session file. That's why I'd rather call the option sessions
or similar.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/dead-keys-on-gnome-uk-keyboard/21451/8
as wayland gets more popular we will have more issues such as: https://github.com/NixOS/nixpkgs/issues/139546
any ideas for the name?