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
docs: describe $IN_NIX_SHELL values #2796
Conversation
See commit 1bffd83
@@ -14,7 +14,8 @@ | |||
<varlistentry><term><envar>IN_NIX_SHELL</envar></term> | |||
|
|||
<listitem><para>Indicator that tells if the current environment was set up by | |||
<command>nix-shell</command>.</para></listitem> | |||
<command>nix-shell</command>. Since Nix 2.0 the values are | |||
<literal>"pure"</literal> and <literal>"impure"</literal></para></listitem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) I think the quotes belong outside of the <literal>
tags, as the value does not contain the "
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had it without the quotes, but man pages render these as regular words... and that didn't seem sufficient to me.
There is an issue with IN_NIX_SHELL that should be documented. Basically if you are in a nix-shell and call nix-build, it will still think you are in the nix-shell:
This effects haskell a lot. |
That function is a misuse of |
Regardless of being a misuse (or not), is there any argument against fixing that behavior? (i.e. make nix remove this variable from its env, at least for spawned builders) Some fix of this should be trivial IMO. |
Hmm, indeed. I thought that wouldn't be possible without changing the semantics, but it looks like that would work. EDIT #2797 |
I plan to merge this in a few days if noone reacts (assuming I'll still have the permissions :). Perhaps backport to
2.*-maintenance
branches, too.