nixos-config/pkgs/sax2nf.nix

25 lines
773 B
Nix
Raw Permalink Normal View History

2023-11-18 23:30:05 +01:00
{ pkgs, ... }:
pkgs.stdenv.mkDerivation {
name = "SAX2";
sax2 = (pkgs.fetchurl {
url = "https://abrudz.github.io/SAX2/SAX2.ttf";
sha256 = "sha256-t7Se4Hkojznrret/gb1y1uVnecENTuKtQv11ygafMPY=";
});
patcher = (pkgs.fetchzip {
url = "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/FontPatcher.zip";
sha256 = "sha256-ZJpF/Q5lfcW3srb2NbJk+/QEuwaFjdzboa+rl9L7GGE=";
stripRoot = false;
});
dontUnpack = true;
nativeBuildInputs = [ pkgs.fontforge (pkgs.python3.withPackages (p: [ p.fontforge ])) ];
buildPhase = ''
mkdir -p $out/share/fonts/truetype
python3 -OO $patcher/font-patcher --complete --careful --custom ${pkgs.fira-code}/share/fonts/truetype/FiraCode-VF.ttf -out $out/share/fonts/truetype $sax2
'';
}