1
0
Fork 0
nixos-config/nixos/roles/fonts.nix
2023-02-24 17:35:55 +01:00

78 lines
1.7 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
config,
pkgs,
lib,
...
}: {
fonts = {
fontconfig = {
enable = true;
cache32Bit = true;
defaultFonts = let
unicode-fallback = ["Noto Sans Symbols" "Noto Sans Symbols2"];
in {
monospace = ["CozetteVector" "Noto Sans Mono"] ++ unicode-fallback;
sansSerif = ["B612" "Noto Sans"] ++ unicode-fallback;
serif = ["Libertinus Serif" "Noto Serif"] ++ unicode-fallback;
};
};
fonts = builtins.attrValues {
inherit
(pkgs)
libertinus
# nice text font
material-icons
# icons in my app
tamzen
# 12px
cozette
# 13px
# too wide: dina-font
# cant find font in there: efont-unicode
# too wide: envypn-font
spleen
# Great if you need 8 px font, also nice on 12px.
gohufont
tewi-font
# Too wide tracking: curie
scientifica
# Quite cool on: 11px
# biwidth: too small
# Too wide tracking: creep
# For all my terminal needs.
b612
# sans font, very good for displays
noto-fonts
# for unicode fallback
;
};
};
# create a cache of the font sources, often slow internet connections make it painful to
# re-download them after a few months
environment.etc = let
# fonts with src attributes
font_sources = map (v: v.src) (lib.filter (v: v ? src) config.fonts.fonts);
in
builtins.listToAttrs (lib.imap0
(n: source:
lib.nameValuePair "src-cache/fonts/${toString n}" {
inherit source;
})
font_sources);
}