2020-08-08 20:15:08 +01:00
|
|
|
{ stdenv, fetchurl, config
|
|
|
|
, acceptLicense ? config.joypixels.acceptLicense or false
|
|
|
|
}:
|
2019-08-20 04:32:06 +01:00
|
|
|
|
2020-08-10 09:39:26 +01:00
|
|
|
let inherit (stdenv.hostPlatform.parsed) kernel;
|
2020-08-06 12:17:41 +01:00
|
|
|
|
2020-08-08 20:00:04 +01:00
|
|
|
systemSpecific = {
|
2020-08-10 09:39:26 +01:00
|
|
|
darwin = rec {
|
2020-08-08 20:00:04 +01:00
|
|
|
systemTag = "nix-darwin";
|
|
|
|
capitalized = systemTag;
|
|
|
|
ext = "ttc";
|
|
|
|
fontFile = "Apple%20Color%20Emoji.ttc";
|
|
|
|
name = "joypixels-apple-color-emoji.ttc";
|
|
|
|
};
|
2020-08-10 09:39:26 +01:00
|
|
|
}.${kernel.name} or rec {
|
2020-08-14 17:44:54 +01:00
|
|
|
systemTag = "nixos";
|
2020-08-08 20:00:04 +01:00
|
|
|
capitalized = "NixOS";
|
|
|
|
ext = "ttf";
|
|
|
|
fontFile = "joypixels-android.ttf";
|
|
|
|
name = fontFile;
|
|
|
|
};
|
2020-08-06 12:17:41 +01:00
|
|
|
|
2020-08-08 20:00:04 +01:00
|
|
|
joypixels-free-license = with systemSpecific; {
|
2020-08-07 20:55:15 +01:00
|
|
|
spdxId = "LicenseRef-JoyPixels-Free-6.0";
|
|
|
|
fullName = "JoyPixels Free License Agreement 6.0";
|
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/license/free-license.pdf";
|
2020-08-11 18:49:06 +01:00
|
|
|
free = false;
|
2020-08-07 20:55:15 +01:00
|
|
|
};
|
2020-08-08 20:00:04 +01:00
|
|
|
|
|
|
|
joypixels-license-appendix = with systemSpecific; {
|
2020-08-07 20:55:15 +01:00
|
|
|
spdxId = "LicenseRef-JoyPixels-NixOS-Appendix";
|
|
|
|
fullName = "JoyPixels ${capitalized} License Appendix";
|
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/appendix/joypixels-license-appendix.pdf";
|
2020-08-11 18:49:06 +01:00
|
|
|
free = false;
|
2020-08-07 20:55:15 +01:00
|
|
|
};
|
|
|
|
|
2020-08-16 20:02:02 +01:00
|
|
|
throwLicense = throw ''
|
|
|
|
Use of the JoyPixels font requires acceptance of the license.
|
|
|
|
- ${joypixels-free-license.fullName} [1]
|
|
|
|
- ${joypixels-license-appendix.fullName} [2]
|
2020-08-07 20:52:38 +01:00
|
|
|
|
2020-08-16 20:02:02 +01:00
|
|
|
You can express acceptance by setting acceptLicense to true in your
|
|
|
|
configuration. Note that this is not a free license so it requires allowing
|
|
|
|
unfree licenses.
|
2020-08-07 20:55:15 +01:00
|
|
|
|
2020-08-16 20:02:02 +01:00
|
|
|
configuration.nix:
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
nixpkgs.config.joypixels.acceptLicense = true;
|
|
|
|
|
|
|
|
config.nix:
|
|
|
|
allowUnfree = true;
|
|
|
|
joypixels.acceptLicense = true;
|
2020-08-14 17:41:46 +01:00
|
|
|
|
2020-08-16 20:02:02 +01:00
|
|
|
[1]: ${joypixels-free-license.url}
|
|
|
|
[2]: ${joypixels-license-appendix.url}
|
|
|
|
'';
|
2020-08-07 20:55:15 +01:00
|
|
|
|
2020-08-16 20:02:02 +01:00
|
|
|
in
|
2020-08-07 20:55:15 +01:00
|
|
|
|
2020-08-07 20:52:38 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "joypixels";
|
|
|
|
version = "6.0.0";
|
2020-08-06 12:17:41 +01:00
|
|
|
|
2020-08-16 20:02:02 +01:00
|
|
|
src = assert !acceptLicense -> throwLicense;
|
|
|
|
with systemSpecific; fetchurl {
|
|
|
|
inherit name;
|
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/font/${version}/${fontFile}";
|
|
|
|
sha256 = {
|
|
|
|
darwin = "043980g0dlp8vd4qkbx6298fwz8ns0iwbxm0f8czd9s7n2xm4npq";
|
|
|
|
}.${kernel.name} or "1vxqsqs93g4jyp01r47lrpcm0fmib2n1vysx32ksmfxmprimb75s";
|
|
|
|
};
|
2019-08-20 04:32:06 +01:00
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-08-08 20:00:04 +01:00
|
|
|
installPhase = with systemSpecific; ''
|
2020-08-07 20:52:38 +01:00
|
|
|
install -Dm644 $src $out/share/fonts/truetype/joypixels.${ext}
|
|
|
|
'';
|
2019-08-20 04:32:06 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-08-07 20:54:33 +01:00
|
|
|
description = "The finest emoji you can use legally (formerly EmojiOne)";
|
|
|
|
longDescription = ''
|
|
|
|
New for 2020! JoyPixels 6.0 includes 3,342 originally crafted icon
|
|
|
|
designs and is 100% Unicode 13 compatible. We offer the largest selection
|
|
|
|
of files ranging from png, svg, iconjar, sprites, and fonts.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.joypixels.com/fonts";
|
2020-08-07 20:55:15 +01:00
|
|
|
license = let free-license = joypixels-free-license;
|
|
|
|
appendix = joypixels-license-appendix;
|
2020-08-16 20:02:02 +01:00
|
|
|
in with systemSpecific; {
|
2020-08-07 20:55:15 +01:00
|
|
|
spdxId = "LicenseRef-JoyPixels-Free-6.0-with-${capitalized}-Appendix";
|
|
|
|
fullName = "${free-license.fullName} with ${appendix.fullName}";
|
|
|
|
url = free-license.url;
|
|
|
|
appendixUrl = appendix.url;
|
2020-08-11 18:49:06 +01:00
|
|
|
free = false;
|
2020-08-07 20:55:15 +01:00
|
|
|
};
|
2020-08-06 11:37:25 +01:00
|
|
|
maintainers = with maintainers; [ toonn jtojnar ];
|
2019-08-20 04:32:06 +01:00
|
|
|
};
|
|
|
|
}
|