joypixels: Move assert to allow override
By moving the assert concerning license acceptance into the src attribute license acceptance can be expressed with an override, `joypixels.override { acceptLicense = true; }`.
This commit is contained in:
parent
ca61c67381
commit
fd653b992a
@ -34,9 +34,7 @@ let inherit (stdenv.hostPlatform.parsed) kernel;
|
|||||||
free = false;
|
free = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
throwLicense = throw ''
|
||||||
|
|
||||||
assert !acceptLicense -> throw ''
|
|
||||||
Use of the JoyPixels font requires acceptance of the license.
|
Use of the JoyPixels font requires acceptance of the license.
|
||||||
- ${joypixels-free-license.fullName} [1]
|
- ${joypixels-free-license.fullName} [1]
|
||||||
- ${joypixels-license-appendix.fullName} [2]
|
- ${joypixels-license-appendix.fullName} [2]
|
||||||
@ -55,13 +53,16 @@ assert !acceptLicense -> throw ''
|
|||||||
|
|
||||||
[1]: ${joypixels-free-license.url}
|
[1]: ${joypixels-free-license.url}
|
||||||
[2]: ${joypixels-license-appendix.url}
|
[2]: ${joypixels-license-appendix.url}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "joypixels";
|
pname = "joypixels";
|
||||||
version = "6.0.0";
|
version = "6.0.0";
|
||||||
|
|
||||||
src = with systemSpecific; fetchurl {
|
src = assert !acceptLicense -> throwLicense;
|
||||||
|
with systemSpecific; fetchurl {
|
||||||
inherit name;
|
inherit name;
|
||||||
url = "https://cdn.joypixels.com/distributions/${systemTag}/font/${version}/${fontFile}";
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/font/${version}/${fontFile}";
|
||||||
sha256 = {
|
sha256 = {
|
||||||
@ -85,7 +86,7 @@ stdenv.mkDerivation rec {
|
|||||||
homepage = "https://www.joypixels.com/fonts";
|
homepage = "https://www.joypixels.com/fonts";
|
||||||
license = let free-license = joypixels-free-license;
|
license = let free-license = joypixels-free-license;
|
||||||
appendix = joypixels-license-appendix;
|
appendix = joypixels-license-appendix;
|
||||||
in {
|
in with systemSpecific; {
|
||||||
spdxId = "LicenseRef-JoyPixels-Free-6.0-with-${capitalized}-Appendix";
|
spdxId = "LicenseRef-JoyPixels-Free-6.0-with-${capitalized}-Appendix";
|
||||||
fullName = "${free-license.fullName} with ${appendix.fullName}";
|
fullName = "${free-license.fullName} with ${appendix.fullName}";
|
||||||
url = free-license.url;
|
url = free-license.url;
|
||||||
|
Loading…
Reference in New Issue
Block a user