doc: add note on which variables are effective

The build log of the following won't output `foo` as one might expect, but the
`$PATH` set by stdenv.

```nix
with import <nixpkgs> {};
runCommand "foo" { PATH = "foo"; } "echo $PATH; touch $out"
```
This commit is contained in:
Valentin Gagarin 2023-11-13 21:23:56 +01:00 committed by fricklerhandwerk
parent 7ae1fdc9a7
commit 25c0077a31

View File

@ -13,6 +13,7 @@ rec {
Run the shell command `buildCommand' to produce a store path named `name'.
The attributes in `env' are added to the environment prior to running the command.
Environment variables set by `stdenv.mkDerivation` take precedence.
By default `runCommand` runs in a stdenv with no compiler environment.
`runCommandCC` uses the default stdenv, `pkgs.stdenv`.