From 16fb3928533c02d11a23d748f838f386d0a813fd Mon Sep 17 00:00:00 2001 From: Atemu Date: Tue, 20 Jul 2021 21:20:59 +0200 Subject: [PATCH] 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 --- lib/licenses.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/licenses.nix b/lib/licenses.nix index 5f5cf3490cf7..ce970c58fd5f 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.