diff options
Diffstat (limited to 'lib/licenses.nix')
-rw-r--r-- | lib/licenses.nix | 69 |
1 files changed, 45 insertions, 24 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix index a608d3ec3f543..9b25bd4bcea84 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -1,25 +1,29 @@ { lib }: - -lib.mapAttrs (lname: lset: let - defaultLicense = { - shortName = lname; - free = true; # Most of our licenses are Free, explicitly declare unfree additions as such! - deprecated = false; - }; - - mkLicense = licenseDeclaration: let - applyDefaults = license: defaultLicense // license; - applySpdx = license: - 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) ({ +let + inherit (lib) optionalAttrs; + + mkLicense = lname: { + shortName ? lname, + # Most of our licenses are Free, explicitly declare unfree additions as such! + free ? true, + deprecated ? false, + spdxId ? null, + url ? null, + fullName ? null, + redistributable ? free + }@attrs: { + inherit shortName free deprecated redistributable; + } // optionalAttrs (attrs ? spdxId) { + inherit spdxId; + url = "https://spdx.org/licenses/${spdxId}.html"; + } // optionalAttrs (attrs ? url) { + inherit url; + } // optionalAttrs (attrs ? fullName) { + inherit fullName; + }; + +in +lib.mapAttrs mkLicense ({ /* License identifiers from spdx.org where possible. * If you cannot find your license here, then look for a similar license or * add it to this list. The URL mentioned above is a good source for inspiration. @@ -317,6 +321,12 @@ in mkLicense lset) ({ free = false; }; + cc-by-nd-40 = { + spdxId = "CC-BY-ND-4.0"; + fullName = "Creative Commons Attribution-No Derivative Works v4.0"; + free = false; + }; + cc-by-sa-10 = { spdxId = "CC-BY-SA-1.0"; fullName = "Creative Commons Attribution Share Alike 1.0"; @@ -718,6 +728,12 @@ in mkLicense lset) ({ redistributable = false; }; + databricks-license = { + fullName = "Databricks License"; + url = "https://www.databricks.com/legal/db-license"; + free = false; + }; + fair = { fullName = "Fair License"; spdxId = "Fair"; @@ -917,7 +933,7 @@ in mkLicense lset) ({ ncbiPd = { spdxId = "NCBI-PD"; - fullname = "NCBI Public Domain Notice"; + fullName = "NCBI Public Domain Notice"; # Due to United States copyright law, anything with this "license" does not have a copyright in the # jurisdiction of the United States. However, other jurisdictions may assign the United States # government copyright to the work, and the license explicitly states that in such a case, no license @@ -1089,6 +1105,11 @@ in mkLicense lset) ({ url = "https://qwt.sourceforge.io/qwtlicense.html"; }; + radiance = { + fullName = "The Radiance Software License, Version 2.0"; + url = "https://github.com/LBNL-ETA/Radiance/blob/master/License.txt"; + }; + ruby = { spdxId = "Ruby"; fullName = "Ruby License"; @@ -1161,7 +1182,7 @@ in mkLicense lset) ({ shortName = "TSL"; fullName = "Timescale License Agreegment"; url = "https://github.com/timescale/timescaledb/blob/main/tsl/LICENSE-TIMESCALE"; - unfree = true; + free = false; }; tcltk = { @@ -1297,7 +1318,7 @@ in mkLicense lset) ({ zsh = { url = "https://github.com/zsh-users/zsh/blob/master/LICENCE"; - fulllName = "Zsh License"; + fullName = "Zsh License"; }; zpl20 = { |