overlays/iosevka: refactor family name in spacing overlay

This commit is contained in:
Primrose 2026-01-23 01:41:44 +01:00
parent 9230f7b378
commit bc67b4226f
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
3 changed files with 16 additions and 17 deletions

View file

@ -38,7 +38,7 @@ let
]
)
[
(import ./spacings.nix { inherit lib; })
(import ./spacings.nix)
([ identityOverlay ] ++ import ./variants.nix)
];
@ -46,9 +46,8 @@ let
overlay:
let
mergedConfig = lib.fix (lib.extends overlay iosevkaConfig);
toKebabCase = x: builtins.replaceStrings [ " " ] [ "-" ] (lib.toLower x);
in
lib.nameValuePair (toKebabCase mergedConfig.family) (mkIosevka mergedConfig)
lib.nameValuePair mergedConfig.family (mkIosevka mergedConfig)
);
iosevka-nerds = builtins.mapAttrs (_: mkNerdFont) iosevkas;

View file

@ -1,24 +1,24 @@
{ lib }:
let
list = [
{ spacing = "normal"; }
{
adjustFamily = old: old;
spacing = "normal";
}
# Iosevka + Ghostty makes "…" display in a odd way.
# We use "term" width to avoid this.
# https://github.com/ghostty-org/ghostty/discussions/10335
{ spacing = "term"; }
{
adjustFamily = old: old + "Term";
spacing = "term";
}
];
in
map (
{ spacing }@cfg:
let
name = lib.toSentenceCase spacing;
in
final: prev:
cfg
// {
family = prev.family + "-${name}";
{ adjustFamily, spacing }:
final: prev: {
family = adjustFamily prev.family;
inherit spacing;
}
) list

View file

@ -82,10 +82,10 @@ in
map (
{ name, code }:
let
kebabName = builtins.replaceStrings [ " " ] [ "-" ] name;
shortName = builtins.replaceStrings [ " " ] [ "" ] name;
in
final: prev: {
family = prev.family + "-${kebabName}";
family = prev.family + "${shortName}";
variants = prev.variants // {
inherits = code;
};