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

Bjørn Forsman bjorn.forsman at gmail.com
Sat Aug 24 12:00:39 CEST 2013


On 20 August 2013 13:37, Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:
> Hi,
>
> On 19/08/13 21:48, Bjørn Forsman wrote:
>
>> pkgs/lib/licenses.nix is currently a mix of strings and attrsets. This
>> causes nixpkgs-lint to incorrectly say that some packages lack a
>> license, even though they don't:
> ...
>> Eelco, commit https://github.com/NixOS/nixpkgs/commit/80213cbb051f2e172be20c03e51069f122d8bb6c
>> changed some (but not all) of the licenses from attrsets to strings.
>> What is the plan for the rest of the licenses? Should I make a
>> pull-request to change everything to strings?
>
> 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.

With all licenses as strings[1]:

$ nixpkgs-lint -f.
error: value is a string while an attribute set was expected
/nix/store/gy2kpf3ra96rrigxqkkhgh0ixmkqplz1-nixpkgs-lint-1/bin/.nixpkgs-lint-wrapped:
evaluation of ‘.’ failed

How do I find out where the expectation of the attribute set is located?

[1]: https://github.com/bjornfor/nixpkgs/commit/ba84be008e45ee85a9fa2c18e0dae284686ade26


More information about the nix-dev mailing list