smiley-sans: improve code

This commit is contained in:
Candy Cloud 2022-12-18 08:14:22 +08:00 committed by GitHub
parent e7592807fb
commit 558544c1b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,24 +1,20 @@
{ lib, stdenvNoCC, fetchurl, unzip }:
{ lib, stdenvNoCC, fetchzip }:
stdenvNoCC.mkDerivation rec {
pname = "smiley-sans";
version = "1.0.0";
src = fetchurl {
src = fetchzip {
url = "https://github.com/atelier-anchor/smiley-sans/releases/download/v${version}/smiley-sans-v${version}.zip";
sha256 = "sha256-gpPJuf1Eye5rP6tpaGJEUFnk2Ys0GhSNRUT5HQE2P8E=";
sha256 = "sha256-LE0CZkWiXjyuiEk316ABCNQL9n5GID8CipjBIu2o6uk=";
stripRoot = false;
};
unpackPhase = ''
${unzip}/bin/unzip $src
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts
install -Dm644 -t $out/share/fonts/opentype *.otf
install -Dm644 -t $out/share/fonts/truetype *.ttf
install -Dm644 -t $out/share/fonts/smiley-sans *.woff2
install -Dm644 -t $out/share/fonts/woff2 *.woff2
runHook postInstall
'';