2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2020-10-22 03:31:18 +02:00
|
|
|
, fetchurl
|
|
|
|
, config
|
2020-08-08 21:15:08 +02:00
|
|
|
, acceptLicense ? config.joypixels.acceptLicense or false
|
|
|
|
}:
|
2019-08-20 05:32:06 +02:00
|
|
|
|
2020-10-22 03:31:18 +02:00
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform.parsed) kernel;
|
2020-08-06 13:17:41 +02:00
|
|
|
|
2020-10-22 03:31:18 +02:00
|
|
|
systemSpecific = {
|
|
|
|
darwin = rec {
|
|
|
|
systemTag = "nix-darwin";
|
|
|
|
capitalized = systemTag;
|
|
|
|
fontFile = "JoyPixels-SBIX.ttf";
|
2020-08-07 21:55:15 +02:00
|
|
|
};
|
2020-10-22 03:31:18 +02:00
|
|
|
}.${kernel.name} or rec {
|
|
|
|
systemTag = "nixos";
|
|
|
|
capitalized = "NixOS";
|
|
|
|
fontFile = "joypixels-android.ttf";
|
|
|
|
};
|
2020-08-08 21:00:04 +02:00
|
|
|
|
2020-10-22 03:31:18 +02:00
|
|
|
joypixels-free-license = with systemSpecific; {
|
|
|
|
spdxId = "LicenseRef-JoyPixels-Free-6.0";
|
|
|
|
fullName = "JoyPixels Free License Agreement 6.0";
|
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/license/free-license.pdf";
|
|
|
|
free = false;
|
|
|
|
};
|
2020-08-07 21:55:15 +02:00
|
|
|
|
2020-10-22 03:31:18 +02:00
|
|
|
joypixels-license-appendix = with systemSpecific; {
|
|
|
|
spdxId = "LicenseRef-JoyPixels-NixOS-Appendix";
|
|
|
|
fullName = "JoyPixels ${capitalized} License Appendix";
|
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/appendix/joypixels-license-appendix.pdf";
|
|
|
|
free = false;
|
|
|
|
};
|
2020-08-07 21:52:38 +02:00
|
|
|
|
2020-10-22 03:31:18 +02: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 21:55:15 +02:00
|
|
|
|
2020-10-22 03:31:18 +02: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-09-16 22:37:17 +02:00
|
|
|
|
2020-10-22 03:31:18 +02:00
|
|
|
configuration.nix:
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
nixpkgs.config.joypixels.acceptLicense = true;
|
2020-08-14 18:41:46 +02:00
|
|
|
|
2020-10-22 03:31:18 +02:00
|
|
|
config.nix:
|
|
|
|
allowUnfree = true;
|
|
|
|
joypixels.acceptLicense = true;
|
|
|
|
|
|
|
|
[1]: ${joypixels-free-license.url}
|
|
|
|
[2]: ${joypixels-license-appendix.url}
|
|
|
|
'';
|
2020-08-07 21:55:15 +02:00
|
|
|
|
2020-08-16 21:02:02 +02:00
|
|
|
in
|
2020-08-07 21:55:15 +02:00
|
|
|
|
2020-08-07 21:52:38 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "joypixels";
|
2021-07-14 11:21:40 +02:00
|
|
|
version = "6.6.0";
|
2020-08-06 13:17:41 +02:00
|
|
|
|
2020-08-16 21:02:02 +02:00
|
|
|
src = assert !acceptLicense -> throwLicense;
|
|
|
|
with systemSpecific; fetchurl {
|
2020-09-16 22:37:17 +02:00
|
|
|
name = fontFile;
|
2020-08-16 21:02:02 +02:00
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/font/${version}/${fontFile}";
|
|
|
|
sha256 = {
|
2021-07-14 11:21:40 +02:00
|
|
|
darwin = "0qcmb2vn2nykyikzgnlma627zhks7ksy1vkgvpcmqwyxq4bd38d7";
|
|
|
|
}.${kernel.name} or "17gjaz7353zyprmds64p01qivy2r8pwf88nvvhi57idas2qd604n";
|
2020-08-16 21:02:02 +02:00
|
|
|
};
|
2019-08-20 05:32:06 +02:00
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-08-08 21:00:04 +02:00
|
|
|
installPhase = with systemSpecific; ''
|
2020-10-22 03:31:18 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-09-16 22:37:17 +02:00
|
|
|
install -Dm644 $src $out/share/fonts/truetype/${fontFile}
|
2020-10-22 03:31:18 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-08-07 21:52:38 +02:00
|
|
|
'';
|
2019-08-20 05:32:06 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-08-07 21:54:33 +02:00
|
|
|
description = "The finest emoji you can use legally (formerly EmojiOne)";
|
|
|
|
longDescription = ''
|
2021-07-14 11:21:40 +02:00
|
|
|
Updated for 2021! JoyPixels 6.6 includes 3,559 originally crafted icon
|
2021-03-02 00:58:49 +01:00
|
|
|
designs and is 100% Unicode 13.1 compatible. We offer the largest
|
|
|
|
selection of files ranging from png, svg, iconjar, sprites, and fonts.
|
2020-08-07 21:54:33 +02:00
|
|
|
'';
|
|
|
|
homepage = "https://www.joypixels.com/fonts";
|
2020-10-22 03:31:18 +02:00
|
|
|
license =
|
|
|
|
let
|
|
|
|
free-license = joypixels-free-license;
|
|
|
|
appendix = joypixels-license-appendix;
|
2020-08-16 21:02:02 +02:00
|
|
|
in with systemSpecific; {
|
2020-08-07 21:55:15 +02: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 19:49:06 +02:00
|
|
|
free = false;
|
2020-08-07 21:55:15 +02:00
|
|
|
};
|
2020-08-06 12:37:25 +02:00
|
|
|
maintainers = with maintainers; [ toonn jtojnar ];
|
2019-08-20 05:32:06 +02:00
|
|
|
};
|
|
|
|
}
|