forked from mirrors/nixpkgs
add .overrideDerivation and .overrideAttrs to packages created with callPackages
/callPackagesWith
nix/nixUnstable, tomcatN and postgresqlNN use `callPackages` pattern, they have .override attribute, but lack .overrideDerivation and recent .overrideAttrs. Packages created with `callPackage` have all of those. Because .overrideDerivation function is used in public, without this we can break code when refactoring callPackage -> callPackages.
This commit is contained in:
parent
3fd44e2912
commit
9d55479e07
|
@ -106,11 +106,9 @@ rec {
|
|||
let
|
||||
f = if builtins.isFunction fn then fn else import fn;
|
||||
auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs;
|
||||
finalArgs = auto // args;
|
||||
pkgs = f finalArgs;
|
||||
mkAttrOverridable = name: pkg: pkg // {
|
||||
override = newArgs: mkAttrOverridable name (f (finalArgs // newArgs)).${name};
|
||||
};
|
||||
origArgs = auto // args;
|
||||
pkgs = f origArgs;
|
||||
mkAttrOverridable = name: pkg: makeOverridable (newArgs: (f newArgs).${name}) origArgs;
|
||||
in lib.mapAttrs mkAttrOverridable pkgs;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue