fira-code: Use pre‐built variable fount

This commit is contained in:
Mikael 2024-08-27 21:44:24 +02:00
parent 9b459b30fe
commit b4ad550973
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0
2 changed files with 9 additions and 39 deletions

View file

@ -30,9 +30,7 @@ in lib.mkIf (osConfig.hardware.graphics.enable or false) {
home.packages = with pkgs; [ home.packages = with pkgs; [
lato lato
(self.packages.${pkgs.system}.fira-code.override { self.packages.${pkgs.system}.fira-code
fontFeatures = [ "cv01" "cv06" "onum" "ss01" "ss03" "ss06" "ss07" "ss08" "zero" ];
})
mplus-outline-fonts.githubRelease mplus-outline-fonts.githubRelease
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
noto-fonts noto-fonts

View file

@ -1,48 +1,20 @@
{ ... }: { { ... }: { stdenv, lib, fetchzip }:
stdenv,
lib,
fetchFromGitHub,
python3,
ttfautohint,
fontFeatures ? [ ]
}:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
__structuredAttrs = true;
pname = "fira-code"; pname = "fira-code";
version = "unstable-2024-02-29"; version = "unstable-2024-08-27";
src = fetchFromGitHub { src = fetchzip {
owner = "tonsky"; url = "https://github.com/illdefined/FiraCode/releases/download/unstable-2024-08-27/Fira_Code_8557c11.zip";
repo = "FiraCode"; stripRoot = false;
rev = "34cced2a1235e2035fb1f258f228b0ed584b8911"; hash = "sha256-pcxwlqTntP+/tNOX+MPG+YTiSv1odX4fa3zBfJViQGQ=";
hash = "sha256-1cLjAqdm2oG39ML9CuVeoQKb9SR1QX9k7qt2cfl7098=";
}; };
nativeBuildInputs = [ dontBuild = true;
(python3.withPackages (ps: with ps; [ fontmake ]))
ttfautohint
];
inherit fontFeatures;
postPatch = ''
patchShebangs script
'';
buildPhase = ''
runHook preBuild
./script/bake_in_features.sh "''${fontFeatures[@]}"
./script/build_ttf.sh
runHook postBuild
'';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -D -m 0644 -t "$out/share/fonts" distr/ttf/Fira\ Code/*.ttf install -D -m 0644 -t "$out/share/fonts" "variable_ttf/Fira Code/FiraCode-VF.ttf"
runHook postInstall runHook postInstall
''; '';
}) })