3
0
Fork 0
forked from mirrors/nixpkgs

buildEnv: respect meta.outputsToInstall

As a result `systemPackages` now also respect it.
Only nix-env remains and that has a PR filed:
    https://github.com/NixOS/nix/pull/815
This commit is contained in:
Vladimír Čunát 2016-03-14 12:15:58 +01:00
parent 3342f717da
commit 2995439003
3 changed files with 10 additions and 6 deletions

View file

@ -122,11 +122,7 @@ in
system.path = pkgs.buildEnv {
name = "system-path";
paths =
# The default output probably shouldn't be globally configurable.
# Services and users should specify them explicitly unless they want this default.
map (p: if p.outputUnspecified or false then p.bin or p.out or p else p)
config.environment.systemPackages;
paths = config.environment.systemPackages;
inherit (config.environment) pathsToLink extraOutputsToLink;
ignoreCollisions = true;
# !!! Hacky, should modularise.

View file

@ -48,7 +48,12 @@ runCommand name
meta pathsToLink extraPrefix postBuild buildInputs;
pkgs = builtins.toJSON (map (drv: {
paths =
[ drv ]
# First add the usual output(s): respect if user has chosen explicitly,
# and otherwise use `meta.outputsToInstall` (guaranteed to exist by stdenv).
(if (drv.outputUnspecified or false)
then map (outName: drv.${outName}) drv.meta.outputsToInstall
else [ drv ])
# Add any extra outputs specified by the caller of `buildEnv`.
++ lib.filter (p: p!=null)
(builtins.map (outName: drv.${outName} or null) extraOutputsToLink);
priority = drv.meta.priority or 5;

View file

@ -225,6 +225,9 @@ let
# If the packager hasn't specified `outputsToInstall`, choose a default,
# namely `p.bin or p.out or p`;
# if he has specified it, it will be overridden below in `// meta`.
# Note: This default probably shouldn't be globally configurable.
# Services and users should specify outputs explicitly,
# unless they are comfortable with this default.
// { outputsToInstall =
let
outs = outputs'; # the value passed to derivation primitive