mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
nix-shell: Use shell.nix as the default expression if it exists
This commit is contained in:
parent
84a8b5e9af
commit
b632153ebd
2 changed files with 14 additions and 7 deletions
|
@ -31,20 +31,26 @@
|
||||||
<arg><option>--command</option> <replaceable>cmd</replaceable></arg>
|
<arg><option>--command</option> <replaceable>cmd</replaceable></arg>
|
||||||
<arg><option>--exclude</option> <replaceable>regexp</replaceable></arg>
|
<arg><option>--exclude</option> <replaceable>regexp</replaceable></arg>
|
||||||
<arg><option>--pure</option></arg>
|
<arg><option>--pure</option></arg>
|
||||||
<arg choice='plain' rep='repeat'><replaceable>paths</replaceable></arg>
|
<arg><replaceable>path</replaceable></arg>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsection><title>Description</title>
|
<refsection><title>Description</title>
|
||||||
|
|
||||||
<para>The command <command>nix-shell</command> will build
|
<para>The command <command>nix-shell</command> will build the
|
||||||
the dependencies of the specified derivation, but not the derivation
|
dependencies of the specified derivation, but not the derivation
|
||||||
itself. It will then start an interactive shell in which all
|
itself. It will then start an interactive shell in which all
|
||||||
environment variables defined by the derivation have been set to their
|
environment variables defined by the derivation
|
||||||
corresponding values, and the script <literal>$stdenv/setup</literal>
|
<replaceable>path</replaceable> have been set to their corresponding
|
||||||
has been sourced. This is useful for reproducing the environment of a
|
values, and the script <literal>$stdenv/setup</literal> has been
|
||||||
|
sourced. This is useful for reproducing the environment of a
|
||||||
derivation for development.</para>
|
derivation for development.</para>
|
||||||
|
|
||||||
|
<para>If <replaceable>path</replaceable> is not given,
|
||||||
|
<command>nix-shell</command> defaults to
|
||||||
|
<filename>shell.nix</filename> if it exists, and
|
||||||
|
<filename>default.nix</filename> otherwise.</para>
|
||||||
|
|
||||||
</refsection>
|
</refsection>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,8 @@ for (my $n = 0; $n < scalar @ARGV; $n++) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@exprs = ("./default.nix") if scalar @exprs == 0;
|
@exprs = ("shell.nix") if scalar @exprs == 0 && $runEnv && -e "shell.nix";
|
||||||
|
@exprs = ("default.nix") if scalar @exprs == 0;
|
||||||
|
|
||||||
$ENV{'IN_NIX_SHELL'} = 1 if $runEnv;
|
$ENV{'IN_NIX_SHELL'} = 1 if $runEnv;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue