nixos: inline set-environment for bash and zsh#30418
Merged
LnL7 merged 1 commit intoNixOS:masterfrom Mar 8, 2018
Merged
Conversation
fpletz
approved these changes
Oct 14, 2017
Contributor
|
What is this good for? |
Member
|
@orivej I'd guess one file less to read. |
Contributor
|
That does not sound impressive. |
Member
Author
|
Just for simplicity, I've seen some people on irc having trouble figuring out where environment variables like NIX_PATH come from because they where searching in |
9 tasks
oxij
pushed a commit
to oxij/nixpkgs
that referenced
this pull request
Aug 30, 2018
A shared exported guard `__NIXOS_SET_ENVIRONMENT_DONE` is introduced that can be used to prevent child shells from sourcing `system.build.setEnvironment` the second time. This fixes e.g. `nix run derivation` when run from e.g. ZSH through the console or ssh. Before this Bash would resource the common environment resetting the `PATH` environment variable. We also export `system.build.setEnvironment` to `/etc/set-environment` making it easy to reset the common environment with `. /etc/set-environment` when needed and to grep for environment variables in `/etc` (which was the motivation of NixOS#30418). This reverts changes made in b00a3fc (the original NixOS#30418).
Member
|
Follow up: #45784. |
xeji
pushed a commit
that referenced
this pull request
Sep 6, 2018
A shared exported guard `__NIXOS_SET_ENVIRONMENT_DONE` is introduced that can be used to prevent child shells from sourcing `system.build.setEnvironment` the second time. This fixes e.g. `nix run derivation` when run from e.g. ZSH through the console or ssh. Before this Bash would resource the common environment resetting the `PATH` environment variable. We also export `system.build.setEnvironment` to `/etc/set-environment` making it easy to reset the common environment with `. /etc/set-environment` when needed and to grep for environment variables in `/etc` (which was the motivation of #30418). This reverts changes made in b00a3fc (the original #30418). (cherry picked from commit d273db4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Things done
build-use-sandboxinnix.confon non-NixOS)