2016-11-26 00:37:43 +01:00
|
|
|
|
/* This is the implementation of the ‘derivation’ builtin function.
|
|
|
|
|
It's actually a wrapper around the ‘derivationStrict’ primop. */
|
2012-01-04 12:04:19 +01:00
|
|
|
|
|
2014-04-04 21:53:47 +02:00
|
|
|
|
drvAttrs @ { outputs ? [ "out" ], ... }:
|
2012-01-03 15:01:47 +01:00
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
2012-01-04 12:04:19 +01:00
|
|
|
|
strict = derivationStrict drvAttrs;
|
2012-11-26 15:39:10 +01:00
|
|
|
|
|
2012-01-04 12:56:15 +01:00
|
|
|
|
commonAttrs = drvAttrs // (builtins.listToAttrs outputsList) //
|
|
|
|
|
{ all = map (x: x.value) outputsList;
|
|
|
|
|
inherit drvAttrs;
|
|
|
|
|
};
|
2012-01-04 12:04:19 +01:00
|
|
|
|
|
2012-01-03 16:27:18 +01:00
|
|
|
|
outputToAttrListElement = outputName:
|
|
|
|
|
{ name = outputName;
|
2012-01-04 12:04:19 +01:00
|
|
|
|
value = commonAttrs // {
|
2012-01-03 16:27:18 +01:00
|
|
|
|
outPath = builtins.getAttr outputName strict;
|
2012-01-03 15:01:47 +01:00
|
|
|
|
drvPath = strict.drvPath;
|
|
|
|
|
type = "derivation";
|
2012-01-04 13:00:39 +01:00
|
|
|
|
inherit outputName;
|
2012-01-04 12:04:19 +01:00
|
|
|
|
};
|
2012-01-03 15:01:47 +01:00
|
|
|
|
};
|
2012-11-26 15:39:10 +01:00
|
|
|
|
|
2012-01-04 12:04:19 +01:00
|
|
|
|
outputsList = map outputToAttrListElement outputs;
|
2012-11-26 15:39:10 +01:00
|
|
|
|
|
2012-01-04 12:04:19 +01:00
|
|
|
|
in (builtins.head outputsList).value
|