-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate using upstream desktop session files #39871
Comments
Currently NixOS' own session files aren't sourcing |
I like the idea of using Using pam/systemd to deal with the environment seems like good idea, so we could simplify and possibly remove the huge session script. We could use the wayland sessions as a testing ground for using upstream desktop files perhaps? Though it might just bring more complexity than it's worth to support both at the same time, not sure if it's easy to get pam to do different stuff depending on the session being launched. Also not sure how to deal with launching eg. dbus and pulseaudio? Another complication using upstream session files might be launching desktop environments with a custom window manager? Though that isn't a problem with wayland. Somewhat off topic, I'm guessing the most straightforward way of adding wayland support would be bypassing the existing xsession system since it's quite intricate and adds X specific things in a lot of places. So simply make a separate store path for wayland .desktop files (eg. |
GDM (@halfline) is open to merging our
Pulseaudio should be socket activated, dbus session is launched by
I think that will still require custom desktop files – for example, flashback uses
I still think the following procedure (i.e. skipping the
|
Ah, that's good.
Right, that sounds reasonable. I'm guessing the same goes for all the desktop environments. Stand alone window managers would probably need some custom code, but that should be doable.
It's absolutely a lot cleaner that's for sure so if we could make it work it's preferable. Seems like good plan. |
Also relevant: [gnome-session] Integrate better with systemd: https://bugzilla.gnome.org/show_bug.cgi?id=690866 |
Another thing that the current solution fails to do is setting |
Related: #43984 |
See #43992 for inital attempt. |
There is now an initiative for the systemd session stuff: https://wiki.gnome.org/Initiatives/SystemdUser |
Ah, so our work will null soon as expected 🤣 |
For Plasma on Wayland I would also like to use the upstream desktop files. |
Tested wayland using the new upstream session support. Unsurprisingly the Did get it to run though after some troubles trying to patch in the |
Okay, think I've figured out the problem.
I think the underlying issue was that |
Pushed a cleaned up branch here: https://github.com/hedning/nixpkgs/commits/gnome-upstream-wayland |
Very good job! I opened a merge request with the |
Ah, nice, that's much cleaner. I'll rebase and get rid of the
I'm also thinking that it might be better to patch |
I would not call the I guess upstream does not really a way to run different commands per session other than switching on For what is worth, |
We are patching GDM to respect GDM_SESSIONS_DIR environment variable, which we are setting in the GDM module. Previously, we only took care of a single code path, the one that handled session start-up; missing the one obtaining the list of sessions. This commit patches the second code path, and also whitelists the GDM_SESSIONS_DIR so that it can be passed to the greeter. Fixes #34101
This is basically done right? |
Do we still want to declare the sessions in passthru? |
Right, there's that too. Yes, I'm not happy about seeing the trace all time. I'd say either in passthru or something like this:
This might be cleaner, as the it's a bit closer to where it's being used? Though it should be possible to do some sanity checking in |
Passing session names through extraSessionsFilePackages also makes it clear that this is required when adding new extraSessionsFilePackages. It's not very obvious that session names are required in the package passthru. Furthermore it will be easier for users to add an package to extraSessionsFilePackages in configuration.nix without having to modify the package itself. If that sounds reasonable I can write up a PR. |
I am not a fan of that, since it moves the responsibility for listing the sessions in the package from packager to user. It might be useful as a filter when package contains more sessions but I think that is a rare use case and would be more of a nuisance most of the time.
While technically feasible, I do not think it is a good idea since it mixes two different concerns: making session files available and choosing a default session file.
Yeah, I think this should be validated in the module. Perhaps something like types.listOf (types.package // {
name = "session-package";
check = a: types.package.check a && a ? passthru.providedSessions;
})
I think this really should be packager’s responsibility. Since the session files are a new mechanism there should not be any breakage. |
Yes, that's the downside. Lets go forward with passthru then 👍
That would be good.
Yes, I was thinking of checking that the sessions provided in passthru is actually present, hopefully catching any typos or changing .desktop names as early as possible. I agree that it doesn't make much sense checking the default session there.
Regarding this, could we rename to the simpler I'll try to write something like this up shortly. |
I used the |
GDM distinguishes wayland sessions by them being in
wayland-sessions
directory, so if we want to support those, we need abandon the flat desktops derivation (af03c20c548a6836e5cc62f3431a4f905f7b564b).GDM_SESSIONS_DIR
variable will not be enough either, we would need to addGDM_WAYLAND_SESSIONS_DIR
, or even better, load the session files fromXDG_DATA_DIRS
. I tried that but it picked up session files as well. Perhaps we should get rid of our xsession code and just use the upstream files.We are doing some extra things but they could be moved to pam or removed completely, see the following conversation from
irc.gnome.org#gdm
The text was updated successfully, but these errors were encountered: