git.iko.soy/typeable/nixpkgs
on master help sign in
pkgs/top-level/stage.nix: don't override `overlays` and `config` in `nixpkgsFun`

`nixpkgsFun` already sets them via `args`. Doing this also introduces unexpected hard to debug errors, see the patch.

commit83ae1ffed43f5dc54bcfd58655974293d215df6e authorJan Malakhovski <oxij@oxij.org> dateSat 23 Feb 2019, 00:00 (8 years ago) parent5aa813d
2 files changed+8−2
pkgs/top-level/default.nix+8 pkgs/top-level/stage.nix−2
pkgs/top-level/default.nix+8
@@ -98,6 +98,14 @@ in let
9898 # compiling toolchains and 32-bit packages on x86_64). In both those cases we
9999 # want the provided non-native `localSystem` argument to affect the stdenv
100100 # chosen.
101+ #
102+ # NB!!! This thing gets its `config` argument from `args`, i.e. it's actually
103+ # `config0`. It is important to keep it to `config0` format (as opposed to the
104+ # result of `evalModules`, i.e. the `config` variable above) throughout all
105+ # nixpkgs evaluations since the above function `config0 -> config` implemented
106+ # via `evalModules` is not idempotent. In other words, if you add `config` to
107+ # `newArgs`, expect strange very hard to debug errors! (Yes, I'm speaking from
108+ # experience here.)
101109 nixpkgsFun = newArgs: import ./. (args // newArgs);
102110
103111 # Partially apply some arguments for building bootstraping stage pkgs
pkgs/top-level/stage.nix−2
@@ -135,7 +135,6 @@ let
135135 # default GNU libc on Linux systems. Non-Linux systems are not
136136 # supported.
137137 pkgsMusl = if stdenv.hostPlatform.isLinux then nixpkgsFun {
138− inherit overlays config;
139138 ${if stdenv.hostPlatform == stdenv.buildPlatform
140139 then "localSystem" else "crossSystem"} = {
141140 parsed = stdenv.hostPlatform.parsed // {
@@ -152,7 +151,6 @@ let
152151 # All packages built for i686 Linux.
153152 # Used by wine, firefox with debugging version of Flash, ...
154153 pkgsi686Linux = if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86 then nixpkgsFun {
155− inherit overlays config;
156154 ${if stdenv.hostPlatform == stdenv.buildPlatform
157155 then "localSystem" else "crossSystem"} = {
158156 parsed = stdenv.hostPlatform.parsed // {