Remove applyGlobalOverrides's pkgsOrig argument.

This patch change the behaviour or overridePackages:

 - Before, overridePackages was based on top of the set of packages
   overriden by `~/.nixpkgs/config.nix` file.

 - After, overridePackages should when given a function f, behave almost¹
   the same as-if the packageOverrides attribute of `~/.nixpkgs/config.nix`
   file attribute was set to f, assuming that we ignore the extra `self`
   argument.

¹ It is not yet exactly the same because we have many paths which are
re-entering nixpkgs while taking the default attributes, such as the
bootstrap phase of stdenv.  Thus if the nixpkgs configuration overrides any
of the dependencies need for the bootstrap, then we might get different sha.
This commit is contained in:
Nicolas B. Pierron 2016-03-20 15:27:14 +00:00
parent 007500f2ec
commit 5e3ce6334c
1 changed files with 6 additions and 6 deletions

View File

@ -95,7 +95,7 @@ let
# (un-overriden) set of packages, allowing packageOverrides
# attributes to refer to the original attributes (e.g. "foo =
# ... pkgs.foo ...").
pkgs = applyGlobalOverrides pkgsInit (self: config.packageOverrides or (super: {}));
pkgs = applyGlobalOverrides (self: config.packageOverrides or (super: {}));
# stdenvOverrides is used to avoid circular dependencies for building the
# standard build environment. This mechanism use the override mechanism to
@ -108,16 +108,16 @@ let
lib.optionalAttrs (crossSystem == null && pkgs.stdenv ? overrides)
(pkgs.stdenv.overrides pkgs);
# The un-overriden packages, passed to `overrider'.
pkgsInit = pkgsFun pkgs;
# Return the complete set of packages, after applying the overrides
# returned by the `overrider' function (see above). Warning: this
# function is very expensive!
applyGlobalOverrides = pkgsOrig: overrider:
applyGlobalOverrides = overrider:
let
overrides = overrider pkgs pkgsOrig // stdenvOverrides pkgsOrig;
# The un-overriden packages, passed to `overrider'.
pkgsOrig = pkgsFun pkgs;
# The overriden, final packages.
pkgs = pkgsFun pkgs // overrides;
in pkgs;
@ -167,7 +167,7 @@ let
#
# The result is `pkgs' where all the derivations depending on `foo'
# will use the new version.
overridePackages = f: applyGlobalOverrides pkgs f;
overridePackages = f: applyGlobalOverrides f;
# Override system. This is useful to build i686 packages on x86_64-linux.
forceSystem = system: kernel: (import ./../..) {