ibm-plex: use installFonts hook

This commit is contained in:
ners
2026-04-23 15:33:51 +02:00
parent 4cf561b5d3
commit 68b20088b4
+16 -13
View File
@@ -2,6 +2,8 @@
lib,
stdenvNoCC,
fetchzip,
symlinkJoin,
installFonts,
families ? [ ],
}:
let
@@ -18,22 +20,23 @@ stdenvNoCC.mkDerivation {
pname = "ibm-plex";
inherit version;
srcs = map (
family:
fetchzip {
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip";
hash = availableFamilies.${family};
}
) selectedFamilies;
src = symlinkJoin {
name = "ibm-plex-src";
paths = map (
family:
fetchzip {
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-${family}%40${version}/ibm-plex-${family}.zip";
hash = availableFamilies.${family};
}
) selectedFamilies;
postBuild = ''
find "$out" \( -name hinted -or -name unhinted -or -name split \) -exec rm -fr {} +
'';
};
dontUnpack = true;
sourceRoot = ".";
installPhase = ''
runHook preInstall
find $srcs -type f -name '*.otf' -exec install -Dm644 {} -t $out/share/fonts/opentype \;
runHook postInstall
'';
nativeBuildInputs = [ installFonts ];
passthru.updateScript = ./update.sh;