nix/pkgs/iosevka-lyteterm-min.nix

30 lines
739 B
Nix
Raw Normal View History

2024-02-02 15:28:57 -06:00
{
pkgs,
fonttools,
brotli,
2024-02-02 17:55:55 -06:00
iosevka-lyteterm,
2024-02-02 15:28:57 -06:00
...
}: let
2024-02-02 17:55:55 -06:00
BASE_FONTS = "${iosevka-lyteterm}/share/fonts/truetype";
2024-02-02 15:28:57 -06:00
in
pkgs.stdenvNoCC.mkDerivation {
inherit BASE_FONTS;
2024-02-02 17:55:55 -06:00
pname = "iosevka-lyteterm-min";
version = iosevka-lyteterm.version;
2024-02-02 15:28:57 -06:00
# do I need to include makesubset.bash and subset-glyphs.txt?
buildInputs = [fonttools brotli];
srcs = [
BASE_FONTS
./makesubset.bash
];
installPhase = ''
mkdir -p "$out/share/fonts/truetype"
for f in "$BASE_FONTS"/dist/iosevkalyteweb/woff2/*.woff2; do
if [[ $f == *".subset.woff2"* ]]; then
pyftsubset "$f" --name-IDs+=0,4,6 --text-file=./subset-glyphs.txt --flavor=woff2 &
fi
done
wait
'';
}