mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 12:29:02 +02:00
top-level: Document why nixpkgsFun
doesn't close over inferred default arguments
This commit is contained in:
parent
05c12f147e
commit
a55d1ecc90
|
@ -55,8 +55,15 @@ in let
|
||||||
# whatever arguments it doesn't explicitly provide. This way,
|
# whatever arguments it doesn't explicitly provide. This way,
|
||||||
# `all-packages.nix` doesn't know more than it needs too.
|
# `all-packages.nix` doesn't know more than it needs too.
|
||||||
#
|
#
|
||||||
# It's OK that `args` doesn't include the defaults: they'll be
|
# It's OK that `args` doesn't include default arguemtns from this file:
|
||||||
# deterministically inferred the same way.
|
# 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);
|
nixpkgsFun = newArgs: import ./. (args // newArgs);
|
||||||
|
|
||||||
# Partially apply some arguments for building bootstraping stage pkgs
|
# Partially apply some arguments for building bootstraping stage pkgs
|
||||||
|
|
Loading…
Reference in a new issue