-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
bug: hm-session-vars forces variables to be only set once, forcing log-out or reboot for Gnome users #3999
Comments
It's not just for performance but also because variables can append to others (e.g. if you have a non-empty |
Actually... Quick follow-ups, this could work, too:
Results in
There's myriad solutions 🎉 |
i think having everything else update except your PATH when making changes would be even more confusing than the status quo and could lead to things breaking in unexpected ways. It would also lead to inconsistencies between graphical applications and terminals. That said I agree that it'd be nice if this was solved, I'm just not sure how best to do that. (Honestly I think graphical sessions running shell profile scripts is probably not ideal in general. The Arch wiki claims that GDM does not do this for Wayland sessions, although apparently this might not actually be true, at least on Arch?) |
I'll agree partial refreshes and split variables aren't worth arguing further. I'm seeing that it's the user-$UID.scope that needs to be restarted in order to get any of the variables refreshed.
Even if I'm logged out in GDM, the variables don't refresh until I run this. Running this does forcibly end the graphical user session and log me out, so it's certainly no fix for this issue. Two take-aways:
|
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/home-manager-sessionvariables-not-persisted-after-log-out/55021/2 |
this is still an issue! |
Yeah this is still unintuitive to me. I update my conf file and the variables don't show up. Similarly I think there should be a different way for the session to prevent this file from being sourced more than once. It should be the session's responsibility to not source the file twice instead of the file's respondibility to ensure it's callers don't call it twice. This feels a bit like a method returning an error if it's called twice with the same argument saying "dude I already calculated this yesterday". This is the second time I'm trying to trace down why my variables don't show up and bumping into this (bad short term memory). I actually find the suggested change above quite intuitive: having a |
Are you following the right branch?
Is there an existing issue for this?
Issue description
Within
~/nix-profile/etc/profile.d/hm-session-vars.sh
are the lines:Let's call this a "reload blocker". Perhaps these were intended for performance boost but they are having a tremendously faulty effect in a Gnome graphical session.
Gnome loads the user's profile and other variables while logging them in, and these variables (including the reload blocker) are loaded. This means that after the user changes hm-session-vars in their configuration, every single terminal they open has the old variables. The new variables are blocked from loading by the reload blocker.
This forces the user to log-out (expensive in time and closes all programs) or to reboot entirely in my case. The reboot may be a bug in Gnome, but the fix is simple: let's add an option to disable these lines within home-manager.
From my vantage, the tiny amount of variables being reloaded poses absolutely zero performance impact, so I would love for these to be hot-reloaded on every terminal.
Maintainer CC
No response
System information
The text was updated successfully, but these errors were encountered: