fonts: refactor

This commit is contained in:
Charlie Root 2025-03-26 19:16:02 +01:00
commit 753fb58c91
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
2 changed files with 12 additions and 18 deletions

View file

@ -1,12 +0,0 @@
{lib, ...}: let
inherit (lib) mkOption;
inherit (lib.types) package listOf;
in {
options.modules.system.fonts = {
# This defines extra fonts to be installed on the system.
extraFonts = mkOption {
type = listOf package;
default = [];
};
};
}

View file

@ -1,16 +1,21 @@
{pkgs, ...}: let {pkgs, ...}: let
inherit (builtins) mapAttrs; inherit (builtins) mapAttrs;
valiosevka = pkgs.iosevka.override {
custom-iosevka = pkgs.iosevka.override {
privateBuildPlan = { privateBuildPlan = {
family = "Iosevka Custom"; family = "valiosevka";
spacing = "normal"; spacing = "normal";
serifs = "sans"; serifs = "sans";
noCvSs = true; noCvSs = true;
exportGlyphNames = false; exportGlyphNames = false;
variants.inherits = "ss15";
ligations.inherits = "dlig"; ligations.inherits = "dlig";
variants = {
inherits = "ss15";
design = {
e = "flat-crossbar";
f = "diagonal-tailed-crossbar-at-x-height";
};
};
}; };
set = "Fancy"; set = "Fancy";
}; };
@ -29,6 +34,7 @@ in {
# Enable font hinting. Hinting aligns glyphs to pixel boundaries # Enable font hinting. Hinting aligns glyphs to pixel boundaries
# to improve rendering sharpness at low resolution. # to improve rendering sharpness at low resolution.
hinting.enable = true; hinting.enable = true;
# Set the defalt fonts. This was taken from raf, # Set the defalt fonts. This was taken from raf,
# many thanks. # many thanks.
defaultFonts = let defaultFonts = let
@ -50,7 +56,6 @@ in {
packages = builtins.attrValues { packages = builtins.attrValues {
inherit inherit
(pkgs) (pkgs)
# custom-iosevka
material-icons material-icons
material-design-icons material-design-icons
papirus-icon-theme papirus-icon-theme
@ -69,6 +74,7 @@ in {
comic-shanns-mono comic-shanns-mono
symbols-only symbols-only
; ;
inherit valiosevka;
}; };
fontDir = { fontDir = {
# Whether to create a directory with links to all fonts in # Whether to create a directory with links to all fonts in