lib.licenses: added The commons clause license

This commit is contained in:
ByteSudoer 2024-03-21 02:41:09 +01:00
parent 11075319f2
commit ebdf6a1d1e

View File

@ -1,25 +1,31 @@
{ lib }:
lib.mapAttrs (lname: lset: let
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
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 [
in
lib.pipe licenseDeclaration [
applyDefaults
applySpdx
applyRedistributable
];
in mkLicense lset) ({
in
mkLicense lset)
({
/* 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.
@ -386,7 +392,10 @@ in mkLicense lset) ({
spdxId = "CECILL-C";
fullName = "CeCILL-C Free Software License Agreement";
};
commons-clause = {
fullName = "Commons Clause License";
free = false;
};
cpal10 = {
spdxId = "CPAL-1.0";
fullName = "Common Public Attribution License 1.0";
@ -1249,7 +1258,7 @@ in mkLicense lset) ({
spdxId = "XSkat";
fullName = "XSkat License";
};
} // {
} // {
# TODO: remove legacy aliases
agpl3 = {
spdxId = "AGPL-3.0";
@ -1281,4 +1290,4 @@ in mkLicense lset) ({
fullName = "GNU Lesser General Public License v3.0";
deprecated = true;
};
})
})