With multiple outputs, adding attributes to a derivation without
changing the {drv,out}Path is no longer as trivial as simply using the
`//' operator, as we usually want to add the attribute to _each_ output,
and even if we only care about one that one output can be reached via
multiple paths.
For stdenv.mkDerivation, we already had code in place to add passthru
and meta attributes to derivations. This commit simply factors part of
that code out into a lib function addPassthru, which takes a derivation
and an attribute set and appends the attribute set to each output of the
derivation.
Signed-off-by: Shea Levy <shea@shealevy.com>
This is like types.string, but values are merged by putting a newline
in between them. This is mostly useful for configuration file
options, where we don't want values accidentally ending up on the same
line.
Note that almost all options with string type in NixOS should either
be unmergable (i.e. should be marked with ‘types.uniq’) or should
actually be of type ‘lines’. So it might make sense to remove the
merge function for the ‘string’ type eventually.
Might come in handy to actually know when things going to break.
In case you're wondering: Yes, "aszlig" is the name everyone uses in real life
(even my family uses it) and is my pending stage name (not _yet_ officially).
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This is for consistency with terminology in stdenv (and the terms
"hostDrv" and "buildDrv" are not very intuitive, even if they're
consistent with GNU terminology).
It is similar to the BSD license but has a few restrictions regarding government
use. But as I am not a lawyer, I'm not sure if that could be merged with bsd3,
so I'm listing it here separately just to be sure.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
adding useful function foldAttr which behave like fold on attr values grouped by name
(without assertions now)
Signed-off-by: Marc Weber <marco-oweber@gmx.de>