diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2016-11-26 15:34:13 -0800 |
---|---|---|
committer | John Ericson <jericson@galois.com> | 2016-12-01 11:24:33 -0500 |
commit | a55d1ecc9050a50904a13e3a34535990b9e61ae3 (patch) | |
tree | f5947013ae1b149e1ade1698f766817f001ee534 /pkgs/top-level/default.nix | |
parent | 05c12f147e932c990f4b026b9efe0b7a1985461e (diff) | |
download | nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.tar nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.tar.gz nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.tar.bz2 nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.tar.lz nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.tar.xz nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.tar.zst nixpkgs-a55d1ecc9050a50904a13e3a34535990b9e61ae3.zip |
top-level: Document why `nixpkgsFun` doesn't close over inferred default arguments
Diffstat (limited to 'pkgs/top-level/default.nix')
-rw-r--r-- | pkgs/top-level/default.nix | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index 6b61110f1e7..a1f3a1c38c5 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -55,8 +55,15 @@ in let # whatever arguments it doesn't explicitly provide. This way, # `all-packages.nix` doesn't know more than it needs too. # - # It's OK that `args` doesn't include the defaults: they'll be - # deterministically inferred the same way. + # It's OK that `args` doesn't include default arguemtns from this file: + # they'll be deterministically inferred. In fact we must *not* include them, + # because it's important that if some parameter which affects the default is + # substituted with a different argument, the default is re-inferred. + # + # To put this in concrete terms, this function is basically just used today to + # use package for a different platform for the current platform (namely cross + # compiling toolchains and 32-bit packages on x86_64). In both those cases we + # want the provided non-native `system` argument to affect the stdenv chosen. nixpkgsFun = newArgs: import ./. (args // newArgs); # Partially apply some arguments for building bootstraping stage pkgs |