aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/imported-drv-to-derivation.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-11 16:41:22 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-03-11 16:57:48 +0100
commit9950cdec3514949942a79c58764b1ea9bf9d5d57 (patch)
treee514f3102570c3e10034e0c1476b863ca289504e /src/libexpr/imported-drv-to-derivation.nix
parente02481ded216ffb5b06b413e3695d4e11e62e02f (diff)
Move some corepkgs into the nix binary
Diffstat (limited to 'src/libexpr/imported-drv-to-derivation.nix')
-rw-r--r--src/libexpr/imported-drv-to-derivation.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libexpr/imported-drv-to-derivation.nix b/src/libexpr/imported-drv-to-derivation.nix
new file mode 100644
index 000000000..eab8b050e
--- /dev/null
+++ b/src/libexpr/imported-drv-to-derivation.nix
@@ -0,0 +1,21 @@
+attrs @ { drvPath, outputs, name, ... }:
+
+let
+
+ commonAttrs = (builtins.listToAttrs outputsList) //
+ { all = map (x: x.value) outputsList;
+ inherit drvPath name;
+ type = "derivation";
+ };
+
+ outputToAttrListElement = outputName:
+ { name = outputName;
+ value = commonAttrs // {
+ outPath = builtins.getAttr outputName attrs;
+ inherit outputName;
+ };
+ };
+
+ outputsList = map outputToAttrListElement outputs;
+
+in (builtins.head outputsList).value