-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
gnome3.gnome-session: always run /etc/set-environment on startup #70501
Conversation
gnomes-session sources its environment from a login shell. But if the systemd user environment already contains `__NIXOS_SET_ENVIRONMENT_DONE` the environment setup won't happen correctly. Simply unset this variable to ensure a fresh environment. This was previously handled by a GDM patch, but it no longer works reliably with gnome-sessions systemd session. We still need the GDM patch to handle running other sessions (eg. plasma). See NixOS#48255 for more info on the underlying issue.
c53c5ca
to
a436602
Compare
It seems there's a patch upstream where they copy the same spawn_session code in GDM to gnome-session |
Yeah, I tried to patch it like gdm without success (tried with I mean we want gnome-session to always source the environment on startup, so unsetting |
@hedning I agree. It's very simple 👍 Are there patches we could consolidate in gdm that PAM env makes unneeded? |
So this didn't work completely. While crashing my session a bunch of times testing So I'd say we should work towards getting the pam environment to work correctly and rely on that. Getting the environment sourced correctly from the shell just doesn't work it seems :/ |
Yeah, the failure I saw was with a436602, but without #70430. I'm fairly certain that the wrapperDir fix actually resolves the issue, just strange that a436602 doesn't work by itself. Perhaps the pam environment somehow takes precedent (though that wouldn't explain why eg. the first login works) 😕 I guess with a436602 we can at least be more confident that users will get stuff they've set using |
Motivation for this change
gnomes-session sources its environment from a login shell. But if the systemd
user environment already contains
__NIXOS_SET_ENVIRONMENT_DONE
the environmentsetup won't happen correctly. Simply unset this variable to ensure a fresh
environment.
This was previously handled by a GDM patch, but it no longer works reliably with
gnome-sessions systemd session.
This means we can drop the not so reliable patch in gdm.We still need the patch to handle plasma et. al.See #48255 for more info on the
underlying issue.
With the newly added pam environment (and #70430) this shouldn't be strictly necessary, but it does clean up a now broken fix. No idea why I didn't just fix it like this in the first place 😆 (did it in GDM to handle other sessions obviously).
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @