[Nix-dev] pkgs/lib/licenses.nix: strings or attrsets?

Eelco Dolstra eelco.dolstra at logicblox.com
Tue Aug 20 14:13:19 CEST 2013


Hi,

On 20/08/13 13:55, Vladimír Čunát wrote:

> On 08/20/2013 01:37 PM, Eelco Dolstra wrote:
>> Basically, meta.* attributes have to be (lists of) strings or integers.  They
>> cannot be attribute sets.  So if meta.license is an attribute set, it won't show
>> up in "nix-env -qa --meta --xml" output or in Hydra under a build's "License"
>> field.
>>
>> So yeah, a PR to change everything to strings would be welcome.
> 
> Then I fail to see the point of lib.licenses, as it's easier e.g. to write
> "GPLv2" than lib.licenses.gpl2.

Well, you get an error if you mis-spell an attribute name, but not if you do
that in a string.

> On the other hand, it seemed nice to me that this way we could attach additional
> information, e.g. URL of the full license.

Yes, that would be nice.  It would require adding support for attribute sets in
meta.* values to Nix though (not too hard).

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list