nichts/modules/style/fonts.nix

90 lines
2.2 KiB
Nix
Raw Normal View History

2024-09-04 11:05:36 +02:00
{pkgs, ...}: let
2024-09-03 15:20:22 +02:00
inherit (builtins) mapAttrs;
2025-03-26 19:16:02 +01:00
valiosevka = pkgs.iosevka.override {
2024-11-25 15:41:13 +01:00
privateBuildPlan = {
2025-03-26 19:16:02 +01:00
family = "valiosevka";
2024-11-25 15:41:13 +01:00
spacing = "normal";
serifs = "sans";
noCvSs = true;
exportGlyphNames = false;
2025-03-26 19:16:02 +01:00
2024-11-25 15:41:13 +01:00
ligations.inherits = "dlig";
2025-03-26 19:16:02 +01:00
variants = {
inherits = "ss15";
design = {
e = "flat-crossbar";
f = "diagonal-tailed-crossbar-at-x-height";
};
};
2024-11-25 15:41:13 +01:00
};
set = "Fancy";
};
2024-08-16 10:10:25 +02:00
in {
2024-09-03 15:20:22 +02:00
# A (somewhat) sane list of fonts to be installed.
fonts = {
fontconfig = {
# Whether to enable fontconfig configuration. This will, for
# example, allow fontconfig to discover fonts and configurations
# installed through home.packages and nix-env.
enable = true;
# Enable font antialiasing.
antialias = true;
# Enable font hinting. Hinting aligns glyphs to pixel boundaries
# to improve rendering sharpness at low resolution.
hinting.enable = true;
2025-03-26 19:16:02 +01:00
2024-09-03 15:20:22 +02:00
# Set the defalt fonts. This was taken from raf,
# many thanks.
defaultFonts = let
common = [
"Iosevka Nerd Font"
2024-11-19 14:20:00 +01:00
"Roboto Mono Nerd Font"
"Fira Code Nerd Font"
2024-09-03 15:20:22 +02:00
"Symbols Nerd Font"
"Noto Color Emoji"
];
in
mapAttrs (_: fonts: fonts ++ common) {
serif = ["Noto Serif"];
sansSerif = ["Lexend"];
emoji = ["Noto Color Emoji"];
monospace = ["Iosevka Nerd Font"];
};
};
packages = builtins.attrValues {
inherit
(pkgs)
material-icons
material-design-icons
papirus-icon-theme
lexend
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
corefonts
font-awesome
;
inherit
(pkgs.nerd-fonts)
iosevka
jetbrains-mono
comic-shanns-mono
symbols-only
;
2025-03-26 19:16:02 +01:00
inherit valiosevka;
};
2024-09-03 15:20:22 +02:00
fontDir = {
# Whether to create a directory with links to all fonts in
# /run/current-system/sw/share/X11/fonts
enable = true;
# Whether to decompress fonts in
# /run/current-system/sw/share/X11/fonts
decompressFonts = true;
};
};
2024-08-16 10:10:25 +02:00
}