lib: generalize addPassthru
to extendDerivation
This commit is contained in:
parent
eb6db32d01
commit
b1ca8517ee
@ -131,8 +131,8 @@ rec {
|
|||||||
|
|
||||||
|
|
||||||
/* Add attributes to each output of a derivation without changing
|
/* Add attributes to each output of a derivation without changing
|
||||||
the derivation itself. */
|
the derivation itself and check a given condition when evaluating. */
|
||||||
addPassthru = drv: passthru:
|
extendDerivation = condition: passthru: drv:
|
||||||
let
|
let
|
||||||
outputs = drv.outputs or [ "out" ];
|
outputs = drv.outputs or [ "out" ];
|
||||||
|
|
||||||
@ -142,13 +142,22 @@ rec {
|
|||||||
outputToAttrListElement = outputName:
|
outputToAttrListElement = outputName:
|
||||||
{ name = outputName;
|
{ name = outputName;
|
||||||
value = commonAttrs // {
|
value = commonAttrs // {
|
||||||
inherit (drv.${outputName}) outPath drvPath type outputName;
|
inherit (drv.${outputName}) type outputName;
|
||||||
|
drvPath = assert condition; drv.${outputName}.drvPath;
|
||||||
|
outPath = assert condition; drv.${outputName}.outPath;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputsList = map outputToAttrListElement outputs;
|
outputsList = map outputToAttrListElement outputs;
|
||||||
in commonAttrs // { outputUnspecified = true; };
|
in commonAttrs // {
|
||||||
|
outputUnspecified = true;
|
||||||
|
drvPath = assert condition; drv.drvPath;
|
||||||
|
outPath = assert condition; drv.outPath;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Add attributes to each output of a derivation without changing
|
||||||
|
the derivation itself. */
|
||||||
|
addPassthru = drv: passthru: extendDerivation true passthru drv;
|
||||||
|
|
||||||
/* Strip a derivation of all non-essential attributes, returning
|
/* Strip a derivation of all non-essential attributes, returning
|
||||||
only those needed by hydra-eval-jobs. Also strictly evaluate the
|
only those needed by hydra-eval-jobs. Also strictly evaluate the
|
||||||
|
@ -87,7 +87,8 @@ let
|
|||||||
inherit (stringsWithDeps) textClosureList textClosureMap
|
inherit (stringsWithDeps) textClosureList textClosureMap
|
||||||
noDepEntry fullDepEntry packEntry stringAfter;
|
noDepEntry fullDepEntry packEntry stringAfter;
|
||||||
inherit (customisation) overrideDerivation makeOverridable
|
inherit (customisation) overrideDerivation makeOverridable
|
||||||
callPackageWith callPackagesWith addPassthru hydraJob makeScope;
|
callPackageWith callPackagesWith extendDerivation addPassthru
|
||||||
|
hydraJob makeScope;
|
||||||
inherit (meta) addMetaAttrs dontDistribute setName updateName
|
inherit (meta) addMetaAttrs dontDistribute setName updateName
|
||||||
appendToName mapDerivationAttrset lowPrio lowPrioSet hiPrio
|
appendToName mapDerivationAttrset lowPrio lowPrioSet hiPrio
|
||||||
hiPrioSet;
|
hiPrioSet;
|
||||||
|
Loading…
Reference in New Issue
Block a user