From 5f4cb91a1c022ca20f47ff189dfa0e4c98e5b592 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 17 Mar 2016 20:22:15 +0000 Subject: [PATCH] Move helperfunctions and stdenvAdapters under pkgsFun. The `helperFunctions` and `stdenvAdapters` both use the `pkgs` attribute as input, either to inherit some properties, either to use it as argument. The `pkgs` binding used in both expressions of the `helperFunctions` and `stdenvAdapters` is no longer the result of the `applyGlobalOverrides` function, but the argument of the `pkgsFun` function. The `pkgsFun` functions is called twice under `applyGlobalOverrides`, and in both cases, the first argument of `pkgsFun` correspond to the result of `applyGlobalOverrides`. Thus, this modification will change the bindings, but the evaluation of ``. A third call the `pkgsFun` exists under `overridePackages` in the set of all packages. Previously, the `helperFunctions` and `stdenvAdapaters` would use the functions defined as part of the default `` set. With this modification, the `helperFunctions` and the `stdenvAdapters` are now using the fix-point of the newly evaluated package set. This implies that this modification allow the user to use `overridePackages`, which is already not recommended for performance reasons, to override the inputs of the `helperFucntions` and `stdenvAdapaters` too, where this was not possible before. --- pkgs/top-level/all-packages.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5c4820b584..0a80c5b48d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -83,15 +83,6 @@ let platform = if platform_ != null then platform_ else config.platform or platformAuto; - # Helper functions that are exported through `pkgs'. - helperFunctions = - stdenvAdapters // - (import ../build-support/trivial-builders.nix { inherit lib; inherit (pkgs) stdenv; inherit (pkgs.xorg) lndir; }); - - stdenvAdapters = - import ../stdenv/adapters.nix pkgs; - - # Allow packages to be overriden globally via the `packageOverrides' # configuration option, which must be a function that takes `pkgs' # as an argument and returns a set of new or overriden packages. @@ -128,6 +119,15 @@ let let defaultScope = pkgs // pkgs.xorg; self = self_ // overrides; + + # Helper functions that are exported through `pkgs'. + helperFunctions = + stdenvAdapters // + (import ../build-support/trivial-builders.nix { inherit lib; inherit (pkgs) stdenv; inherit (pkgs.xorg) lndir; }); + + stdenvAdapters = + import ../stdenv/adapters.nix pkgs; + self_ = with self; helperFunctions // (with helperFunctions; { # Make some arguments passed to all-packages.nix available