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

Allows selectively adding environment variables to pure shells. #2323

Merged
merged 1 commit into from Aug 3, 2018

Conversation

samueldr
Copy link
Member

@samueldr samueldr commented Aug 2, 2018

Inlcudes documentation and test.

This implements and fixes #2321


I am unsure about moving keepVars higher up; it will now also affect nix-build. I am requesting your suggestions for this small bit of cleanliness.

@samueldr
Copy link
Member Author

samueldr commented Aug 2, 2018

There was some talk on #nixos about this:

The gist of the discussion boils down to:

  • -p can be used -p hello bash busybox.
  • --keep-var needs to be repeated --keep-var foo --keep-var bar --keep-var baz.

I am personally fine with it being repeated, but I was wondering whether it is fine since there is -p which acts that way.

I would, though, need to add a bit more complexity to the parsing, as right now left is strictly used for -p, so interleaving packages with parameters is possible nix-shell hello bash -p works.


Update (as I was writing). Since nix-shell hello bash -p works, this would be a breaking change. I don't think that this is a good idea to switch to accumulating here unless breaking -p to not read before its use is desired to allow other accumulating parameters in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reducing purity atomically with #! nix-shell
2 participants