Skip to content

Commit

Permalink
stdenv.mkDerivation: remove attrs to other outputs in multi-out deriv…
Browse files Browse the repository at this point in the history
…ation sub-output attrs

In other words, previously a package 'foo' with outputs = [ "dev "bin" ]
would behave like this:

    foo.dev.bin == foo.bin
    foo.bin.dev == foo.dev == foo

After this commit this is no longer the case:

    foo.dev.bin => error: attribute ‘bin’ missing
    foo.bin.dev => error: attribute ‘dev’ missing

The rationale for this is that otherwise it's not possible to do things like:

    environment.systemPackages = [ pkgs.shadow.su ];

... where the 'shadow' package has outputs = [ "out" "su" ] and
systemPackages doing the 'pkg.bin or pkg.out or pkg' dance when choosing
which output(s) to include in the system path.
  • Loading branch information
dezgeg committed Jan 23, 2016
1 parent 9501606 commit 7410c8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/customisation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ rec {

outputToAttrListElement = outputName:
{ name = outputName;
value = commonAttrs // {
value = (builtins.removeAttrs commonAttrs outputs) // {
inherit (drv.${outputName}) outPath drvPath type outputName;
};
};

outputsList = map outputToAttrListElement outputs;
in commonAttrs.${drv.outputName};
in commonAttrs;


/* Strip a derivation of all non-essential attributes, returning
Expand Down

0 comments on commit 7410c8f

Please sign in to comment.