nixos/system/fonts.nix

140 lines
3.6 KiB
Nix
Raw Normal View History

{
stdenv,
findutils,
iosevka,
nerd-font-patcher,
}:
let
custom-build-plan = {
noCvSs = false;
exportGlyphNames = false;
widths.Normal = {
shape = 500;
menu = 5;
css = "normal";
};
weights = {
Regular = {
shape = 400;
menu = 400;
css = 400;
};
Bold = {
shape = 700;
menu = 700;
css = 700;
};
};
slopes = {
Upright = {
angle = 0;
shape = "upright";
menu = "upright";
css = "normal";
};
Italic = {
angle = 9.4;
shape = "italic";
menu = "italic";
css = "italic";
};
};
variants.design = {
capital-g = "toothless-corner-serifless-hooked";
capital-j = "serifed-both-sides";
capital-k = "curly-serifless";
capital-p = "closed-motion-serifed";
capital-q = "crossing";
capital-r = "curly-serifless";
capital-u = "tailed-serifless";
capital-z = "straight-serifless-with-horizontal-crossbar";
a = "double-storey-tailed";
d = "tailed-serifless";
e = "rounded";
f = "tailed-crossbar-at-x-height";
g = "double-storey-open";
h = "tailed-serifless";
i = "tailed-serifed";
j = "serifed";
k = "cursive-serifless";
l = "tailed-serifed";
m = "tailed-serifless";
n = "tailed-serifless";
q = "diagonal-tailed-serifless";
u = "tailed-serifless";
y = "cursive-serifless";
z = "straight-serifless-with-horizontal-crossbar";
lower-delta = "flat-top";
lower-lambda = "tailed-turn";
lower-xi = "flat-top";
lower-chi = "semi-chancery-straight-serifless";
zero = "tall-slashed";
one = "no-base";
two = "straight-neck-serifless";
three = "flat-top-serifless";
four = "semi-open-serifless";
five = "oblique-arched-serifless";
six = "open-contour";
seven = "bend-serifless-crossbar";
eight = "two-circles";
nine = "open-contour";
asterisk = "hex-low";
underscore = "high";
caret = "high";
paren = "normal";
brace = "straight";
number-sign = "slanted";
ampersand = "closed";
at = "fourfold";
percent = "dots";
question = "corner";
lig-ltgteq = "flat";
lig-neq = "more-slanted";
lig-equal-chain = "without-notch";
lig-hyphen-chain = "without-notch";
lig-double-arrow-bar = "without-notch";
lig-single-arrow-bar = "without-notch";
};
};
in
rec {
iosevka-custom = iosevka.override {
set = "Custom";
privateBuildPlan = custom-build-plan // {
family = "Iosevka Custom";
spacing = "normal";
serifs = "sans";
};
};
iosevka-custom-aile = iosevka.override {
set = "CustomAile";
privateBuildPlan = custom-build-plan // {
family = "Iosevka Custom Aile";
spacing = "quasi-proportional";
serifs = "sans";
};
};
iosevka-custom-etoile = iosevka.override {
set = "CustomEtoile";
privateBuildPlan = custom-build-plan // {
family = "Iosevka Custom Etoile";
spacing = "quasi-proportional";
serifs = "slab";
};
};
iosevka-custom-nerdfont = stdenv.mkDerivation {
name = "${iosevka-custom.name}-nerd-font-patched";
src = iosevka-custom;
nativeBuildInputs = [
findutils
nerd-font-patcher
];
buildPhase = ''
find \( -name \*.ttf -o -name \*.otf \) -execdir nerd-font-patcher --variable-width-glyphs --careful --complete --boxdrawing --no-progressbars {} \;
'';
installPhase = ''
cp -a . $out
'';
};
}