forked from mirrors/nixpkgs
haskell-modules: implement overrideScope method for deep overriding
deepOverride turns out to be completely unfeasible for non-trivial overrides. Nix evaluates for an eternity, and then comes back saying: Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS nix-instantiate killed by signal 6 The hand-written deep-override, on the other hand, performs the job in a fraction of a second, no problem. All bow to Russell O'Connor!
This commit is contained in:
parent
d737d463c6
commit
3c8b33eee4
|
@ -31,8 +31,12 @@ let
|
|||
mkDerivation = drv: args.mkDerivation (drv // f drv);
|
||||
});
|
||||
|
||||
callPackageWithScope = scope: drv: args: (stdenv.lib.callPackageWith scope drv args) // {
|
||||
overrideScope = f: callPackageWithScope (fix (extend scope.__unfix__ f)) drv args;
|
||||
};
|
||||
|
||||
defaultScope = pkgs // pkgs.xlibs // pkgs.gnome // self;
|
||||
callPackage = drv: args: stdenv.lib.callPackageWith defaultScope drv args;
|
||||
callPackage = drv: args: callPackageWithScope defaultScope drv args;
|
||||
|
||||
in
|
||||
import ./hackage-packages.nix { inherit pkgs stdenv callPackage; } self // {
|
||||
|
|
Loading…
Reference in a new issue