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