@@ -2,7 +2,7 @@
22# a fork of the buildEnv in the Nix distribution. Most changes should
33# eventually be merged back into the Nix distribution.
44
5−{ perl, runCommand }:
5+{ perl, runCommand, lib }:
66
77{ name
88
@@ -21,6 +21,10 @@
2121 # directories in the list is not symlinked.
2222 pathsToLink ? ["/"]
2323
24+, # The package outputs to include. By default, only the default
25+ # output is included.
26+ outputsToLink ? []
27+
2428, # Root the result in directory "$out${extraPrefix}", e.g. "/share".
2529 extraPrefix ? ""
2630
@@ -36,7 +40,9 @@
3640runCommand name
3741 { inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs;
3842 pkgs = builtins.toJSON (map (drv: {
39− paths = [ drv ]; # FIXME: handle multiple outputs
43+ paths =
44+ [ drv ]
45+ ++ lib.concatMap (outputName: lib.optional (drv.${outputName}.outPath or null != null) drv.${outputName}) outputsToLink;
4046 priority = drv.meta.priority or 5;
4147 }) paths);
4248 preferLocalBuild = true;