mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
Fix interaction between appendOverlays and otherPackageSets
The comment a dirty hack that should be removed has led me to believe that nixpkgsFun isn't the right solution, but bypassing it is worse, because it creates a second, inner overriding mechanism that doesn't pass its changes to the old, outer overriding mechanism. Before this change: nix-repl> ((import <nixpkgs> {}).appendOverlays([(f: s: { foobarbaz = "ok"; })])).foobarbaz "ok" nix-repl> ((import <nixpkgs> {}).appendOverlays([(f: s: { foobarbaz = "ok"; })])).pkgsCross.aarch64-multiplatform.foobarbaz error: attribute 'foobarbaz' missing at «string»:1:1: 1| ((import <nixpkgs> {}).appendOverlays([(f: s: { foobarbaz = "ok"; })])).pkgsCross.aarch64-multiplatform.foobarbaz | ^ 2| After this change: nix-repl> ((import ./. {}).appendOverlays([(f: s: { foobarbaz = "ok"; })])).pkgsCross.aarch64-multiplatform.foobarbaz "ok" Thanks to samueldr for discovering this problem.
This commit is contained in:
parent
b5f2c5f132
commit
eb8e943493
@ -15,7 +15,7 @@
|
|||||||
# Utility functions, could just import but passing in for efficiency
|
# Utility functions, could just import but passing in for efficiency
|
||||||
lib
|
lib
|
||||||
|
|
||||||
, # Use to reevaluate Nixpkgs; a dirty hack that should be removed
|
, # Use to reevaluate Nixpkgs
|
||||||
nixpkgsFun
|
nixpkgsFun
|
||||||
|
|
||||||
## Other parameters
|
## Other parameters
|
||||||
@ -218,7 +218,7 @@ let
|
|||||||
appendOverlays = extraOverlays:
|
appendOverlays = extraOverlays:
|
||||||
if extraOverlays == []
|
if extraOverlays == []
|
||||||
then self
|
then self
|
||||||
else import ./stage.nix (args // { overlays = args.overlays ++ extraOverlays; });
|
else nixpkgsFun { overlays = args.overlays ++ extraOverlays; };
|
||||||
|
|
||||||
# NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB
|
# NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB
|
||||||
# of allocations. DO NOT USE THIS IN NIXPKGS.
|
# of allocations. DO NOT USE THIS IN NIXPKGS.
|
||||||
|
Loading…
Reference in New Issue
Block a user