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

2015-12-13 Thread Mathnerd314
On Sat, Dec 12, 2015 at 6:23 AM, Luca Bruno  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 
> wrote:
>
>> 2015-12-12 13:42 GMT+03:00 Freddy Rietdijk :
>>
>
>>> 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
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


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

2015-12-12 Thread Arseniy Seroka
All licenses that we have are here [1].

[1] https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix

2015-12-12 13:42 GMT+03:00 Freddy Rietdijk :

> Hi Nixers,
>
> The licenses that are used in nixpkgs are specified in .nix format.
> While it is possible to use builtins.toJSON to convert to JSON on-demand,
> I propose that we store the licenses in JSON format instead, separating the
> data from code.
>
> A practical use case is that I would like to match (using Python) raw
> license information to the licenses we have in nixpkgs. I don't want to
> depend on the user having Nix available (just the nixpkgs repository) to
> convert libraries.nix to JSON.
>
> That is my argumentation. What do you think?
>
> Kind regards,
>
> Freddy Rietdijk
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>


-- 
Sincerely,
Arseniy Seroka
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


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

2015-12-12 Thread Luca Bruno
I think that code is so simple that with a small transformation it's json,
without using libnix.

On Sat, Dec 12, 2015 at 11:52 AM, Arseniy Seroka 
wrote:

> All licenses that we have are here [1].
>
> [1] https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix
>
> 2015-12-12 13:42 GMT+03:00 Freddy Rietdijk :
>
>> Hi Nixers,
>>
>> The licenses that are used in nixpkgs are specified in .nix format.
>> While it is possible to use builtins.toJSON to convert to JSON on-demand,
>> I propose that we store the licenses in JSON format instead, separating the
>> data from code.
>>
>> A practical use case is that I would like to match (using Python) raw
>> license information to the licenses we have in nixpkgs. I don't want to
>> depend on the user having Nix available (just the nixpkgs repository) to
>> convert libraries.nix to JSON.
>>
>> That is my argumentation. What do you think?
>>
>> Kind regards,
>>
>> Freddy Rietdijk
>>
>> ___
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>
>
> --
> Sincerely,
> Arseniy Seroka
>
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>


-- 
NixOS Linux 
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev