[Nix-dev] Re: Separating Free/non-free package

Nicolas Pierron nicolas.b.pierron at gmail.com
Mon Sep 21 17:37:39 CEST 2009


Hi,

2009/9/21 Ludovic Courtès <ludo at gnu.org>:
> Hi!
>
> Here’s a first prototype for ‘licenses.nix’:
>
> --8<---------------cut here---------------start------------->8---
> let
>  pkgs = (import ./all-packages.nix) {};
>
>  reviewed = attrName: version: license: free:

free should be deduced from the license, not provided by hand.

>    let pkg = builtins.getAttr attrName pkgs;

The name of the attribute should not have any impact on the package license.

>        fullName = "${attrName}-${version}";

Unfortunately some packages do not respect this rule. (with some extra suffix)

>    in
>      if (fullName == pkg.name
>          && pkg ? meta
>          && pkg.meta ? license
>          && license == pkg.meta.license)

I don't understand, you are duplicating license information if the
license is correct?  Then I don't understand the purpose of this file,
you just need "yes it's correct" line.

>      then ({ name = attrName;
>              value = (pkg // { meta.free = free; }); })

You override all other meta attribute like homepage, description, and so on?

>      else {};
>
>  reviewedPackageList = [
>    (reviewed "guile" "1.8.7" "LGPLv2+" true)
>    (reviewed "libunistring" "0.9.1.1" "LGPLv3+" true)
>    (reviewed "flashplayer" "10.0.32.18" "non-free" false)
>  ];

Yet Another List of Unmaintainable Things ...

>  reviewedPackages = builtins.listToAttrs
>    (pkgs.lib.lists.filter (p: p ? name) reviewedPackageList);
>
>  freePackages = builtins.listToAttrs
>    (pkgs.lib.lists.filter (p: if p ? value
>                               then p.value.meta.free
>                               else false)
>                           reviewedPackageList);
>
> in
>  { inherit reviewedPackages freePackages; }

What If I want only non-free packages?

> --8<---------------cut here---------------end--------------->8---
>
> The ‘reviewed’ bit concerns both the ‘license’ and ‘free’ tags.
>
> It tells the exact version that was audited, so that packages
> automatically leave ‘reviewedPackages’ when updated but not
> “re-reviewed”, as Nicolas suggested.
>
> The obvious drawback is that it’ll need to be updated very often.
> Perhaps we could instead allow for version patterns (e.g., “1.8.*”)
> instead of exact versions.
>
> Comments?

1)

I don't see how such file is more secure than any other file.
Everybody can modify this file.
You need a Hash somewhere which say that the package with its license
are correct as emphasized by the <person name> reviewer.

2)

Your current proposal duplicates the license string:
- easy copy & paste
- not enough talkative (how do you say "GPLV2+" plus some minor
details: "non-free"?)

So, what is the point of duplicating things?

3)

"Free" is not an intrinsic property of the license.  This may depends
on who use it (are you a commercial, an non-profit association).  This
property should be deduced from the license, not provided blindly.

4)

Adding multiple pre-configured filter is not a good method to add such
option on the command line of "nix-env" because you will have to
enumerate each list of packages inside the code of nix-env.  This tool
is more general than Nixpkgs and you don't want Nixpkgs to leak inside
nix-env if there is no general rules exported to Nix (not Nixpkgs).
The other solution is too restrict your usage at:

nix-env -Ai reviewed.freePackages.guile

which is not very nice.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron



More information about the nix-dev mailing list