Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
3.2 kB · 148 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149{ lib, stdenv, unzip, fetchurl,}:
let
hashes = lib.importJSON ./hashes.json;
maple-font = { pname, hash, desc, }: stdenv.mkDerivation rec { inherit pname; version = "7.4"; src = fetchurl { url = "https://github.com/subframe7536/Maple-font/releases/download/v${version}/${pname}.zip"; inherit hash; };
# Work around the "unpacker appears to have produced no directories" # case that happens when the archive doesn't have a subdirectory. sourceRoot = "."; nativeBuildInputs = [ unzip ]; installPhase = '' find . -name '*.ttf' -exec install -Dt $out/share/fonts/truetype {} \; find . -name '*.otf' -exec install -Dt $out/share/fonts/opentype {} \; find . -name '*.woff2' -exec install -Dt $out/share/fonts/woff2 {} \; '';
meta = with lib; { homepage = "https://github.com/subframe7536/Maple-font"; description = '' Open source ${desc} font with round corner and ligatures for IDE and command line ''; license = licenses.ofl; platforms = platforms.all; maintainers = with maintainers; [ oluceps ]; }; };
typeVariants = { truetype = { suffix = "TTF"; desc = "monospace TrueType"; };
truetype-autohint = { suffix = "TTF-AutoHint"; desc = "monospace ttf autohint"; };
variable = { suffix = "Variable"; desc = "monospace variable"; };
woff2 = { suffix = "Woff2"; desc = "WOFF2.0"; };
opentype = { suffix = "OTF"; desc = "OpenType"; };
NF = { suffix = "NF"; desc = "Nerd Font"; };
NF-unhinted = { suffix = "NF-unhinted"; desc = "Nerd Font unhinted"; };
CN = { suffix = "CN"; desc = "monospace CN"; };
CN-unhinted = { suffix = "CN-unhinted"; desc = "monospace CN unhinted"; };
NF-CN = { suffix = "NF-CN"; desc = "Nerd Font CN"; };
NF-CN-unhinted = { suffix = "NF-CN-unhinted"; desc = "Nerd Font CN unhinted"; }; };
ligatureVariants = { No-Ligature = { suffix = "NL"; desc = "No Ligature"; }; Normal-Ligature = { suffix = "Normal"; desc = "Normal Ligature"; }; Normal-No-Ligature = { suffix = "NormalNL"; desc = "Normal No Ligature"; }; };
combinedFonts = lib.concatMapAttrs ( ligName: ligVariant: lib.concatMapAttrs ( typeName: typeVariant: let pname = "MapleMono${ligVariant.suffix}-${typeVariant.suffix}"; in { "${ligVariant.suffix}-${typeVariant.suffix}" = maple-font { inherit pname; desc = "${ligVariant.desc} ${typeVariant.desc}"; hash = hashes.${pname}; }; } ) typeVariants ) ligatureVariants // lib.mapAttrs ( _: value: let pname = "MapleMono-${value.suffix}"; in maple-font { inherit pname; inherit (value) desc; hash = hashes.${pname}; } ) typeVariants;incombinedFonts