[Nix-dev] Store nixpkgs licenses as JSON instead of .nix

Mathnerd314 mathnerd314.gph at gmail.com
Mon Dec 14 04:49:22 CET 2015


On Sat, Dec 12, 2015 at 6:23 AM, Luca Bruno <lethalman88 at gmail.com> wrote:

> I think that code is so simple that with a small transformation it's json,
> without using libnix.
>
Nix itself does an easy transformation:
nix-instantiate --eval --strict --json ./lib/licenses.nix

It is a bit verbose though, we could make it shorter:
{"afl21":{"fullName":"Academic Free License","spdxId":"AFL-2.1"},
"amazonsl":{"free":false,"fullName":"Amazon Software License","url":"
http://aws.amazon.com/asl/"}}

Other than the quoted names it seems reasonable.


> On Sat, Dec 12, 2015 at 11:52 AM, Arseniy Seroka <ars.seroka at gmail.com>
> wrote:
>
>> 2015-12-12 13:42 GMT+03:00 Freddy Rietdijk <freddyrietdijk at fridh.nl>:
>>
>
>>> A practical use case is that I would like to match (using Python) raw
>>> license information to the licenses we have in nixpkgs.
>>>
>> Why not have a big hardcoded table, like in cabal2nix?
https://github.com/NixOS/cabal2nix/blob/master/distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs

Then you would not need Nixpkgs's license list at all, except for reference.

-- Mathnerd314
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20151213/d52757f2/attachment.html 


More information about the nix-dev mailing list