-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Use pam_env to properly setup system-wide env #2692
Conversation
Seems good to me. Maybe |
@@ -58,9 +58,6 @@ in | |||
# Don't edit this file. Set the NixOS option ‘security.sudo.configFile’ instead. | |||
|
|||
# Environment variables to keep for root and %wheel. | |||
Defaults:root,%wheel env_keep+=LOCALE_ARCHIVE | |||
Defaults:root,%wheel env_keep+=NIX_CONF_DIR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm - where did NIX_CONF_DIR go? Shouldn't that be a systemVariable as well then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are systemVariable
s now, obviously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what you are asking about.
NIX_CONF_DIR
is an envVar
, and all the envVar
s are systemVariable
s now.
I like it, and the name 👍 |
I chose the name My guess is that those variables are also available now in services, so we don't have to pass them explicitly, even though I was too lazy to test this. |
BTW, I was going to rename |
Ok, I've checked systemd docs and it looks like that it won't open a PAM session for a service unless explicitly asked to do so (via |
Merged, thanks! |
(cherry picked from commit 18a0cdd)
Picked into release, too. |
Not sure picking into release was a good idea. As mentioned in the comments, this requires a relogin. |
I don't see why requiring relogin should be a problem for release. We e.g. push kernel updates there, and they even need a reboot :-) |
Right, that's not a critical issue, but still there is a difference. |
Yes, it's unfortunate that such things happen... e.g. when running xfce4session the session is killed on typical nixos-rebuild switch (whenever dbus gets restarted IIRC); or trying to resume into the updated system after suspend-to-disk will also fail (at least when kernel changed). I don't know how to approach such updates, where you may need some restarting action. |
I've reverted this in release-14.04, because IMHO this kind of global behaviour change is not a good idea there. At least not until it has had a lot of soak time in master. |
Urgh, I screwed up, reverted it in master instead. Branches are hard... |
…e env"" This reverts commit 491c088.
Heh, OK. |
It's just the thing that I did see people complaining about the channel checkout error right after installation (I ran into that one as well), which is unfixed in our default ISOs now. It could be worked-around by merging #2688 into release instead. |
so all users get this variable, thanks to work from #2692.
(cherry picked from commit 18a0cdd)
This reverts commit b9c312f.
This is the proper fix of #2688.