Skip to content

Commit

Permalink
pkgs/top-level/stage.nix: don't override overlays and config in `…
Browse files Browse the repository at this point in the history
…nixpkgsFun`

`nixpkgsFun` already sets them via `args`. Doing this also introduces unexpected
hard to debug errors, see the patch.
  • Loading branch information
oxij authored and danbst committed Mar 26, 2019
1 parent 921b2cc commit e8dac0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkgs/top-level/default.nix
Expand Up @@ -83,6 +83,14 @@ in let
# compiling toolchains and 32-bit packages on x86_64). In both those cases we
# want the provided non-native `localSystem` argument to affect the stdenv
# chosen.
#
# NB!!! This thing gets its `config` argument from `args`, i.e. it's actually
# `config0`. It is important to keep it to `config0` format (as opposed to the
# result of `evalModules`, i.e. the `config` variable above) throughout all
# nixpkgs evaluations since the above function `config0 -> config` implemented
# via `evalModules` is not idempotent. In other words, if you add `config` to
# `newArgs`, expect strange very hard to debug errors! (Yes, I'm speaking from
# experience here.)
nixpkgsFun = newArgs: import ./. (args // newArgs);

# Partially apply some arguments for building bootstraping stage pkgs
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/stage.nix
Expand Up @@ -135,7 +135,6 @@ let
# default GNU libc on Linux systems. Non-Linux systems are not
# supported.
pkgsMusl = if stdenv.hostPlatform.isLinux then nixpkgsFun {
inherit overlays config;
${if stdenv.hostPlatform == stdenv.buildPlatform
then "localSystem" else "crossSystem"} = {
parsed = stdenv.hostPlatform.parsed // {
Expand All @@ -152,7 +151,6 @@ let
# All packages built for i686 Linux.
# Used by wine, firefox with debugging version of Flash, ...
pkgsi686Linux = if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86 then nixpkgsFun {
inherit overlays config;
${if stdenv.hostPlatform == stdenv.buildPlatform
then "localSystem" else "crossSystem"} = {
parsed = stdenv.hostPlatform.parsed // {
Expand Down

0 comments on commit e8dac0c

Please sign in to comment.