Skip to content

Commit

Permalink
doc/stdenv.xml document substitution env variables
Browse files Browse the repository at this point in the history
The filtering of environment variables that start with an uppercase
letter is documented in the manual.
  • Loading branch information
Profpatsch committed Apr 23, 2016
1 parent 77fa336 commit 3bb93c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion doc/stdenv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,15 @@ PATH=/nix/store/68afga4khv0w...-coreutils-6.12/bin
echo @foo@
</programlisting>

That is, no substitution is performed for undefined variables.</para></listitem>
That is, no substitution is performed for undefined variables.</para>

<para>Environment variables that start with an uppercase letter are filtered out,
to prevent global variables (like <literal>HOME</literal>) from accidentally
getting substituted.
The variables also have to be valid bash “names”, as
defined in the bash manpage (alphanumeric or <literal>_</literal>, must not
start with a number).</para>
</listitem>
</varlistentry>


Expand Down
1 change: 1 addition & 0 deletions pkgs/build-support/substitute/substitute-all.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

args:

# see the substituteAll in the nixpkgs documentation for usage and constaints
stdenv.mkDerivation ({
name = if args ? name then args.name else baseNameOf (toString args.src);
builder = ./substitute-all.sh;
Expand Down

0 comments on commit 3bb93c1

Please sign in to comment.