nixcitizen/fonts.nix
2021-07-21 22:13:28 +02:00

40 lines
1.1 KiB
Nix

{ stdenv, lib, fetchurl, cabextract, pkgs }:
let
regeditfile = pkgs.writeTextFile {
name = "fonts.reg";
text =
''
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts]
"Arial Bold"="Arialbd.TTF"
"Arial Bold Italic"="Arialbi.TTF"
"Arial Italic"="Ariali.TTF"
"Arial"="Arial.TTF"
"Arial Black"="AriBlk.TTF"
'';
};
in stdenv.mkDerivation rec {
name = "ariblk-font";
src = fetchurl {
url = "https://mirrors.kernel.org/gentoo/distfiles/arial32.exe";
sha256 = "85297a4d146e9c87ac6f74822734bdee5f4b2a722d7eaa584b7f2cbf76f478f6";
};
srcblk = fetchurl {
url = "https://mirrors.kernel.org/gentoo/distfiles/arialb32.exe";
sha256 = "a425f0ffb6a1a5ede5b979ed6177f4f4f4fdef6ae7c302a7b7720ef332fec0a8";
};
nativeBuildInputs = [ cabextract ];
unpackPhase = ''
cabextract ${src}
cabextract ${srcblk}
'';
installPhase = ''
mkdir -p $out/share/fonts $out/share/regs
cp *.TTF $out/share/fonts
cp ${regeditfile} $out/share/regs/fonts.reg
'';
}