nichts/modules/style/fonts.nix

73 lines
2 KiB
Nix
Raw Normal View History

2024-08-16 10:10:25 +02:00
{
config,
pkgs,
...
}: let
2024-08-16 22:46:01 +02:00
inherit (config.modules.other.system) username;
2024-09-03 15:20:22 +02:00
inherit (builtins) mapAttrs;
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;
# Set the defalt fonts. This was taken from raf,
# many thanks.
defaultFonts = let
common = [
"Iosevka Nerd Font"
"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 = with pkgs; [
material-icons
2024-08-20 16:43:24 +02:00
material-design-icons
papirus-icon-theme
2024-09-03 15:20:22 +02:00
(nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono" "ComicShannsMono" "NerdFontsSymbolsOnly"];})
lexend
2024-08-20 16:43:24 +02:00
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
corefonts
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;
};
};
# this fixes emoji stuff
2024-08-16 22:46:01 +02:00
home-manager.users.${username} = {
2024-08-16 23:31:12 +02:00
fonts.fontconfig = {
2024-08-16 22:46:01 +02:00
defaultFonts = {
monospace = ["ComicShannsMono Nerd Font" "Noto Color Emoji"];
sansSerif = ["ComicShannsMono Nerd Font" "Noto Color Emoji"];
serif = ["ComicShannsMono Nerd Font" "Noto Color Emoji"];
};
};
};
2024-08-16 10:10:25 +02:00
}