Add nerd-font patched version of custom Iosevka to fonts

Move all of the logic for configuring and building the custom fonts to
iosevka.nix, to keep everything relevant in one place.
This commit is contained in:
Evie Litherland-Smith 2024-03-02 15:04:35 +00:00
parent 5260689aec
commit 7a10373030
2 changed files with 109 additions and 87 deletions

View file

@ -1,4 +1,9 @@
{
stdenv,
iosevka,
nerd-font-patcher,
}: let
customBuildPlan = {
noCvSs = true;
exportGlyphNames = false;
ligations.inherits = "dlig";
@ -53,4 +58,52 @@
lig-double-arrow-bar = "without-notch";
lig-single-arrow-bar = "without-notch";
};
};
in {
etoile = rec {
name = "Iosevka Custom Etoile";
package = iosevka.override {
set = "etoile";
privateBuildPlan = {
inherit (customBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "quasi-proportional";
serifs = "slab";
};
};
};
aile = rec {
name = "Iosevka Custom Aile";
package = iosevka.override {
set = "aile";
privateBuildPlan = {
inherit (customBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "quasi-proportional";
serifs = "sans";
};
};
};
nerdfont = let
font = iosevka.override {
set = "custom";
privateBuildPlan = {
inherit (customBuildPlan) noCvSs exportGlyphNames variants weights;
family = "Iosevka Custom";
spacing = "normal";
serifs = "sans";
};
};
in {
name = "IosevkaCustomNerdFont";
package = stdenv.mkDerivation {
name = "${font.name}-nerd-font-patched";
src = font;
nativeBuildInputs = [nerd-font-patcher];
buildPhase = ''
find \( -name \*.ttf -o -name \*.otf \) -execdir nerd-font-patcher -c {} \;
'';
installPhase = "cp -a . $out";
};
};
}

View file

@ -26,7 +26,9 @@
name = "Catppuccin-${catppuccinVariant}-Dark-Cursors";
};
fonts = let
iosevkaCustomBuildPlan = import ./iosevka.nix;
iosevkaCustom = import ./iosevka.nix {
inherit (pkgs) stdenv iosevka nerd-font-patcher;
};
in {
sizes = {
applications = 16;
@ -34,42 +36,9 @@
popups = 20;
terminal = 16;
};
serif = rec {
name = "Iosevka Custom Etoile";
package = pkgs.iosevka.override {
set = "etoile";
privateBuildPlan = {
inherit (iosevkaCustomBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "quasi-proportional";
serifs = "slab";
};
};
};
sansSerif = rec {
name = "Iosevka Custom Aile";
package = pkgs.iosevka.override {
set = "aile";
privateBuildPlan = {
inherit (iosevkaCustomBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "quasi-proportional";
serifs = "sans";
};
};
};
monospace = rec {
name = "Iosevka Custom";
package = pkgs.iosevka.override {
set = "custom";
privateBuildPlan = {
inherit (iosevkaCustomBuildPlan) noCvSs exportGlyphNames variants weights;
family = name;
spacing = "normal";
serifs = "sans";
};
};
};
serif = {inherit (iosevkaCustom.etoile) name package;};
sansSerif = {inherit (iosevkaCustom.aile) name package;};
monospace = {inherit (iosevkaCustom.nerdfont) name package;};
emoji = {
name = "Noto Color Emoji";
package = pkgs.noto-fonts-emoji;