2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-10-22 01:31:18 +00:00
|
|
|
, fetchurl
|
|
|
|
, config
|
2020-08-08 19:15:08 +00:00
|
|
|
, acceptLicense ? config.joypixels.acceptLicense or false
|
|
|
|
}:
|
2019-08-20 03:32:06 +00:00
|
|
|
|
2020-10-22 01:31:18 +00:00
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform.parsed) kernel;
|
2020-08-06 11:17:41 +00:00
|
|
|
|
2020-10-22 01:31:18 +00:00
|
|
|
systemSpecific = {
|
|
|
|
darwin = rec {
|
|
|
|
systemTag = "nix-darwin";
|
|
|
|
capitalized = systemTag;
|
|
|
|
fontFile = "JoyPixels-SBIX.ttf";
|
2020-08-07 19:55:15 +00:00
|
|
|
};
|
2020-10-22 01:31:18 +00:00
|
|
|
}.${kernel.name} or rec {
|
|
|
|
systemTag = "nixos";
|
|
|
|
capitalized = "NixOS";
|
|
|
|
fontFile = "joypixels-android.ttf";
|
|
|
|
};
|
2020-08-08 19:00:04 +00:00
|
|
|
|
2020-10-22 01:31:18 +00:00
|
|
|
joypixels-free-license = with systemSpecific; {
|
2024-04-30 15:13:38 +00:00
|
|
|
spdxId = "LicenseRef-JoyPixels-Free";
|
|
|
|
fullName = "JoyPixels Free License Agreement";
|
|
|
|
url = "https://cdn.joypixels.com/free-license.pdf";
|
2020-10-22 01:31:18 +00:00
|
|
|
free = false;
|
|
|
|
};
|
2020-08-07 19:55:15 +00:00
|
|
|
|
2020-10-22 01:31:18 +00: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 19:52:38 +00:00
|
|
|
|
2020-10-22 01:31:18 +00: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 19:55:15 +00:00
|
|
|
|
2020-10-22 01:31:18 +00: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 20:37:17 +00:00
|
|
|
|
2020-10-22 01:31:18 +00:00
|
|
|
configuration.nix:
|
2024-04-22 11:16:01 +00:00
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
|
|
|
builtins.elem (lib.getName pkg) [
|
|
|
|
"joypixels"
|
|
|
|
];
|
2020-10-22 01:31:18 +00:00
|
|
|
nixpkgs.config.joypixels.acceptLicense = true;
|
2020-08-14 16:41:46 +00:00
|
|
|
|
2020-10-22 01:31:18 +00:00
|
|
|
config.nix:
|
2024-04-22 11:16:01 +00:00
|
|
|
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
|
|
|
"joypixels"
|
|
|
|
];
|
2020-10-22 01:31:18 +00:00
|
|
|
joypixels.acceptLicense = true;
|
|
|
|
|
|
|
|
[1]: ${joypixels-free-license.url}
|
|
|
|
[2]: ${joypixels-license-appendix.url}
|
|
|
|
'';
|
2020-08-07 19:55:15 +00:00
|
|
|
|
2020-08-16 19:02:02 +00:00
|
|
|
in
|
2020-08-07 19:55:15 +00:00
|
|
|
|
2020-08-07 19:52:38 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "joypixels";
|
2024-04-22 10:14:47 +00:00
|
|
|
version = "8.0.0";
|
2020-08-06 11:17:41 +00:00
|
|
|
|
2020-08-16 19:02:02 +00:00
|
|
|
src = assert !acceptLicense -> throwLicense;
|
|
|
|
with systemSpecific; fetchurl {
|
2020-09-16 20:37:17 +00:00
|
|
|
name = fontFile;
|
2020-08-16 19:02:02 +00:00
|
|
|
url = "https://cdn.joypixels.com/distributions/${systemTag}/font/${version}/${fontFile}";
|
|
|
|
sha256 = {
|
2024-04-22 10:14:47 +00:00
|
|
|
darwin = "0kj4nck6k91avhan9iy3n8hhk47xr44rd1lzljjx3w2yzw1w9zvv";
|
|
|
|
}.${kernel.name} or "1bkyclgmvl6ppbdvidc5xr1g6f215slf0glnh5p6fsfbxc5h95bw";
|
2020-08-16 19:02:02 +00:00
|
|
|
};
|
2019-08-20 03:32:06 +00:00
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-08-08 19:00:04 +00:00
|
|
|
installPhase = with systemSpecific; ''
|
2020-10-22 01:31:18 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-09-16 20:37:17 +00:00
|
|
|
install -Dm644 $src $out/share/fonts/truetype/${fontFile}
|
2020-10-22 01:31:18 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-08-07 19:52:38 +00:00
|
|
|
'';
|
2019-08-20 03:32:06 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-08-07 19:54:33 +00:00
|
|
|
description = "The finest emoji you can use legally (formerly EmojiOne)";
|
|
|
|
longDescription = ''
|
2024-04-22 10:14:47 +00:00
|
|
|
Updated for 2023! JoyPixels 8.0 includes 3,702 originally crafted icon
|
|
|
|
designs and is 100% Unicode 15.0 compatible. We offer the largest
|
|
|
|
selection of files ranging from png, svg, iconjar, and fonts (sprites
|
|
|
|
available upon request).
|
2020-08-07 19:54:33 +00:00
|
|
|
'';
|
|
|
|
homepage = "https://www.joypixels.com/fonts";
|
2024-04-22 11:22:43 +00:00
|
|
|
hydraPlatforms = []; # Just a binary file download, nothing to cache.
|
2020-10-22 01:31:18 +00:00
|
|
|
license =
|
|
|
|
let
|
|
|
|
free-license = joypixels-free-license;
|
|
|
|
appendix = joypixels-license-appendix;
|
2020-08-16 19:02:02 +00:00
|
|
|
in with systemSpecific; {
|
2024-04-30 15:13:38 +00:00
|
|
|
spdxId = "LicenseRef-JoyPixels-Free-with-${capitalized}-Appendix";
|
2020-08-07 19:55:15 +00:00
|
|
|
fullName = "${free-license.fullName} with ${appendix.fullName}";
|
|
|
|
url = free-license.url;
|
|
|
|
appendixUrl = appendix.url;
|
2020-08-11 17:49:06 +00:00
|
|
|
free = false;
|
2020-08-07 19:55:15 +00:00
|
|
|
};
|
2020-08-06 10:37:25 +00:00
|
|
|
maintainers = with maintainers; [ toonn jtojnar ];
|
2024-04-22 11:22:43 +00:00
|
|
|
# Not quite accurate since it's a font, not a program, but clearly
|
|
|
|
# indicates we're not actually building it from source.
|
2024-06-01 09:21:57 +00:00
|
|
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
2019-08-20 03:32:06 +00:00
|
|
|
};
|
|
|
|
}
|