Hi Andreas,
I know exactly what you mean.
I use the following expression in /etc/config.scm
instead of just %desktop-services, to remove login managers on my laptop:
(modify-services (remove (lambda (service)
(or
(eq? (service-kind service) sddm-service-type)
(eq? (service-kind service) gdm-service-type)))
%desktop-services)
After a (very rare on laptops) reboot, I have to log into a system (text)
console like it's 1997 and then type
exec setsid startx
or in my case (Wayland)[1]
exec setsid startw
The "exec" is for safety.
(setsid is so you don't have terminal control Ctrl-Z, Ctrl-C etc either)
Life immediately improved.
I've been through the ordeal of keeping my graphical session working over the
years on my guix--but in the end this is the only practical solution that I
don't have to keep massaging (sadly).
To be clear, login managers are totally useful in a corporate remote login
(thin client) or university computer lab setting.
The intent of login managers is to have a lot of "terminal" computers that you
don't care about (if it breaks throw it in the trash and replace it with any
other terminal computer) that then can access a (or any number of) powerful
server via xdmcp, displaying the remote program's windows on your X "server".
If you don't have this scenario, I'd just remove the complication "login
manager" from my life.
That you can also log in locally using a login manager is... kinda a weird
special case (that nowadays became the normal case ;) ).
A login manager is independent from the X (or Wayland or whatever) session it
starts. In the ideal case, it's just a "routing" station and doesn't influence
the targets. That's why you lose zero features in your target session when you
remove a login manager. (If that were not the case, I would (and did!)
immediately file bug reports--that's how modular the design is)
There's also other graphical "greeters" (also in Guix as services) that should
work for the local case--but I didn't get as far as actually trying them.
Ideally, I'd just have a non-visible greeter (that definitely doesn't lock any
DRM devices :P) that would do the equivalent of startw in a login shell ONCE,
but without the ability to Ctrl-C it.
Has anyone set those very simple graphical greeters up (to not ask the user
anything, just autolaunch hardcoded thing with default user) on guix
successfully?
Since this use case is so common in my opinion it would make sense for the
installer to ask whether you want to have a login manager "Do you want to be
able to select what or where your graphical desktop is on each boot?" (default
to no) or something.
Also "Does this computer have more than one user (asks for credentials on every
boot)?" (default to no). If not, and if disk encryption is on, it can just not
ask for the login credentials AGAIN. As you can see there are dependencies.
Especially in authentication, situations like this happen a lot: It's also
only safe to not ask for the login credentials AGAIN if there's a screen locker
that autolocks the screen (in case the user powered up the computer and went
for a coffee while it's booting, at least it doesn't stay open for more than 5
minutes until it auto-locks. Could even have the autolocker engage immediately
on boot to remove this window of opportunity).
Unfortunately, these kind of policy decisions need someone to do some system
design, and even then will break some use cases[3]--which we'd have to be cold
enough to break on purpose. It would improve user-friendliness a lot, though.
>but I think GDM is still required as the login manager.
I don't think any is required (or should ever be required). They are an
anachronism nowadays. Not sure why not dead. Even for the actual use case,
people use SSH, VNC or RDP to connect to other computers AFTER they logged into
their normal X (or Wayland) session locally. i can count the number of people
that even know what XDMCP is on one hand :)
But %desktop-services defaults to using a login manager. And that default
changed a few years back--I complained about it on this mailing list back then.
It's not okay to swap out defaults from underneath the user like this in a
rolling release distro--it could prevent you to (graphical) login entirely
because whatever desktop you are using didn't install configuration for the
service manager (which is what happened)[2].
>Can I choose the login manager separately from the desktop environment (KDM,
>XDM)?
It is a design goal of login managers to make this possible. If it wasn't
possible after all that then that would be ridiculous :)
>If not, can we somehow get there?
To be able to choose the login manager? Definitely we can change guix to
enable the user be able to choose which login manager to use (that includes
selecting "no login manager").
If it was me designing it, I'd just not have had any login manager in the
original %desktop-services at all to begin with. Whoever wants one (all 30
people in the world /s) can add one.
But now (since we have a login manager in %desktop-services) the question is
how to change it in a backward compatible way. If we decide to change it.
I can only recommend the workaround I have above. If there are other weird
things in %desktop-services, you can also (remove ...) them there.
In engineering systems in general, the cheapest, most reliable and most secure
component is the one that isn't there ;)
[1] $ cat startw
#!/bin/sh
export XDG_SESSION_TYPE=wayland
export WLR_RENDERER=vulkan
exec sway "$@"
[2] For X, share/xsessions/xfce.desktop or something.
[3] https://xkcd.com/1172/