Skip to content
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

Merged
merged 1 commit into from Oct 15, 2019

Conversation

hedning
Copy link
Contributor

@hedning hedning commented Oct 5, 2019

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 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.

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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@worldofpeace
Copy link
Contributor

@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.)

@hedning
Copy link
Contributor Author

hedning commented Oct 14, 2019

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.

@worldofpeace
Copy link
Contributor

worldofpeace commented Oct 14, 2019

@hedning 👍 to this, been rolling with this patch for a bit.
Can you add a comment at the site?

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.
@hedning hedning merged commit 2c7f0f0 into NixOS:master Oct 15, 2019
@hedning hedning deleted the set-session-wrappers-path branch October 15, 2019 11:17
@hedning
Copy link
Contributor Author

hedning commented Oct 15, 2019

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.

dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Feb 4, 2020
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)
rycee pushed a commit to rycee/nixpkgs that referenced this pull request Mar 30, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants