toDerivation: Provide "out" and "outputName" attributes

This commit is contained in:
Eelco Dolstra 2016-09-19 11:51:11 +02:00
parent a36ecba2c9
commit 1c043e0749
1 changed files with 11 additions and 6 deletions

View File

@ -296,12 +296,17 @@ rec {
/* Converts a store path to a fake derivation. */ /* Converts a store path to a fake derivation. */
toDerivation = path: toDerivation = path:
let path' = builtins.storePath path; in let
path' = builtins.storePath path;
res =
{ type = "derivation"; { type = "derivation";
name = builtins.unsafeDiscardStringContext (builtins.substring 33 (-1) (baseNameOf path')); name = builtins.unsafeDiscardStringContext (builtins.substring 33 (-1) (baseNameOf path'));
outPath = path'; outPath = path';
outputs = [ "out" ]; outputs = [ "out" ];
out = res;
outputName = "out";
}; };
in res;
/* If `cond' is true, return the attribute set `as', /* If `cond' is true, return the attribute set `as',