depot/third_party/nixpkgs/pkgs/data/fonts/monocraft/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

39 lines
1.2 KiB
Nix

{ stdenvNoCC, lib, fetchurl }:
let
version = "3.0";
relArtifact = name: hash: fetchurl {
inherit name hash;
url = "https://github.com/IdreesInc/Monocraft/releases/download/v${version}/${name}";
};
in
stdenvNoCC.mkDerivation {
pname = "monocraft";
inherit version;
srcs = [
(relArtifact "Monocraft.otf" "sha256-PA1W+gOUStGw7cDmtEbG+B6M+sAYr8cft+Ckxj5LciU=")
(relArtifact "Monocraft.ttf" "sha256-S4j5v2bTJbhujT3Bt8daNN1YGYYP8zVPf9XXjuR64+o=")
(relArtifact "Monocraft-no-ligatures.ttf" "sha256-MuHfoP+dsXe+ODN4vWFIj50jwOxYyIiS0dd1tzVxHts=")
(relArtifact "Monocraft-nerd-fonts-patched.ttf" "sha256-QxMp8UwcRjWySNHWoNeX2sX9teZ4+tCFj+DG41azsXw=")
];
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
find $srcs -name '*.otf' -exec install -Dm644 --target $out/share/fonts/opentype {} +
find $srcs -name '*.ttf' -exec install -Dm644 --target $out/share/fonts/truetype {} +
runHook postInstall
'';
meta = with lib; {
description = "Programming font based on the typeface used in Minecraft";
homepage = "https://github.com/IdreesInc/Monocraft";
license = licenses.ofl;
platforms = platforms.all;
maintainers = with maintainers; [ zhaofengli ];
};
}