summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2021-07-20 21:20:59 +0200
committerAtemu <atemu.main@gmail.com>2021-08-11 19:07:45 +0200
commit16fb3928533c02d11a23d748f838f386d0a813fd (patch)
tree6234db7bf18e469ba43bf594af62971ddd91bb26 /lib
parent48797d7114d0ba036d9a65b556842ccfee8b4055 (diff)
downloadnixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.tar
nixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.tar.gz
nixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.tar.bz2
nixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.tar.lz
nixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.tar.xz
nixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.tar.zst
nixpkgs-16fb3928533c02d11a23d748f838f386d0a813fd.zip
lib.licenses: introduce `redistributable` attribute
Allows for distinction of licenses that are unfree overall but do grant the
right to redistribute. Defaults to the freeness of the license.

Note: Many unfree but are redistributable licenses aren't marked as such.
I expect that to be fixed in a distributed manner over time.

Closes https://github.com/NixOS/nixpkgs/pull/97789
Diffstat (limited to 'lib')
-rw-r--r--lib/licenses.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix
index 5f5cf3490cf..ce970c58fd5 100644
--- a/lib/licenses.nix
+++ b/lib/licenses.nix
@@ -13,9 +13,11 @@ lib.mapAttrs (lname: lset: let
       if license ? spdxId
       then license // { url = "https://spdx.org/licenses/${license.spdxId}.html"; }
       else license;
+    applyRedistributable = license: { redistributable = license.free; } // license;
   in lib.pipe licenseDeclaration [
     applyDefaults
     applySpdx
+    applyRedistributable
   ];
 in mkLicense lset) ({
   /* License identifiers from spdx.org where possible.