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 @

Sorry, something went wrong.

@hedning hedning requested a review from worldofpeace October 5, 2019 00:39
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 5, 2019
@hedning hedning requested a review from rycee October 5, 2019 00:58
@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 force-pushed the set-session-wrappers-path branch from 8d1e165 to a589847 Compare October 14, 2019 21:37
@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

Verified

This commit was signed with the committer’s verified signature. The key has expired.
dtzWill Will Dietz
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

Verified

This commit was signed with the committer’s verified signature. The key has expired.
rycee Robert Helgesson
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
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants