propagate NIX_BUILD_SHELL also in pure builds document NIX_BUILD_SHELL in the nix-shell command documentation

This commit is contained in:
Fabian Schmitthenner 2015-12-07 15:47:31 +00:00 committed by Eelco Dolstra
parent 80ebd60e7c
commit 0eb200e569
2 changed files with 17 additions and 1 deletions

View file

@ -176,6 +176,22 @@ also <xref linkend="sec-common-options" />.</phrase></para>
</refsection> </refsection>
<refsection><title>Environment variables</title>
<variablelist>
<varlistentry><term><envar>NIX_BUILD_SHELL</envar></term>
<listitem><para>Shell used to start the interactive environment.
Defaults to the <command>bash</command> found in <envar>PATH</envar>.</para></listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection><title>Examples</title> <refsection><title>Examples</title>
<para>To build the dependencies of the package Pan, and start an <para>To build the dependencies of the package Pan, and start an

View file

@ -270,7 +270,7 @@ foreach my $expr (@exprs) {
my $tmp = $ENV{"TMPDIR"} // $ENV{"XDG_RUNTIME_DIR"} // "/tmp"; my $tmp = $ENV{"TMPDIR"} // $ENV{"XDG_RUNTIME_DIR"} // "/tmp";
if ($pure) { if ($pure) {
foreach my $name (keys %ENV) { foreach my $name (keys %ENV) {
next if grep { $_ eq $name } ("HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER"); next if grep { $_ eq $name } ("HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL", "TZ", "PAGER", "NIX_BUILD_SHELL");
delete $ENV{$name}; delete $ENV{$name};
} }
# NixOS hack: prevent /etc/bashrc from sourcing /etc/profile. # NixOS hack: prevent /etc/bashrc from sourcing /etc/profile.