-
-
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
nixos/system-environment: prepend wrapperDir to PATH #70430
Conversation
@hedning Really good catch 👍 I actually noticed this on a couple of occasions now. An aside, I've seen all sorts of upstream reports about environment pollution with the systemd sessions. (etc.) |
I'll merge this soon if no one has any clever ideas on how to accomplish this in a somewhat less ad-hoc way :) It's no fun for users to get stuck in a broken session. |
@hedning 👍 to this, been rolling with this patch for a bit. |
This fixes user environment setup for sessions which doesn't successfully go through a shell init. Note we don't go through `sessionVariables` as we want the wrappers to have highest priority. It would also cause wrapperDir to occur twice when in shell sessions, as it shells use sessionVariables too while prepending wrapperDir in a custom snippet. In particular logging in and out of gnome-shell could result in a broken path without this fix.
8d1e165
to
a589847
Compare
This works at least. We should probably take a look at only specifying wrapperDir once in such a way that both shell and system environments picks it up correctly, but lets do that later. |
This fixes user environment setup for sessions which doesn't successfully go through a shell init. Note we don't go through `sessionVariables` as we want the wrappers to have highest priority. It would also cause wrapperDir to occur twice when in shell sessions, as shells use `sessionVariables` too while prepending wrapperDir in a custom snippet. In particular logging in and out of gnome-shell could result in a broken path without this fix. (cherry picked from commit 2c7f0f0)
This fixes user environment setup for sessions which doesn't successfully go through a shell init. Note we don't go through `sessionVariables` as we want the wrappers to have highest priority. It would also cause wrapperDir to occur twice when in shell sessions, as shells use `sessionVariables` too while prepending wrapperDir in a custom snippet. In particular logging in and out of gnome-shell could result in a broken path without this fix. (cherry picked from commit 2c7f0f0)
Motivation for this change
This fixes user environment setup for sessions which doesn't successfully go
through a shell init.
Note we don't go through
sessionVariables
as we want the wrappers to havehighest priority. It would also cause wrapperDir to occur twice when in shell
sessions, as it shells use sessionVariables too while prepending wrapperDir in a
custom snippet.
In particular logging in and out of gnome-shell could result in a broken path
without this fix.
Some more gnome specifics. Apparently gnome-session now does mess up having the environment reliably set up through a shell. I tried patching gnome-session without luck. This is anyway a better fix though :)
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 @