1
0
Fork 0
nixos-config/system/fonts.nix

33 lines
1 KiB
Nix
Raw Normal View History

2020-05-21 23:13:42 +00:00
{ config, pkgs, lib, ... }: {
2019-07-23 17:19:33 +00:00
fonts = {
fontconfig = {
enable = true;
cache32Bit = true;
defaultFonts = {
2020-05-11 21:34:36 +00:00
monospace = [ "JetBrainsMono Nerd Font" "DejaVu Sans Mono" ];
2020-04-11 20:39:52 +00:00
sansSerif = [ "B612" "DejaVu Sans" ];
2020-05-12 19:52:30 +00:00
serif = [ "Linux Libertine" "DejaVu Serif" ];
2019-07-23 17:19:33 +00:00
};
};
enableDefaultFonts = true;
enableFontDir = true;
2019-07-31 20:36:41 +00:00
fonts = builtins.attrValues {
inherit (pkgs)
2020-05-21 23:13:42 +00:00
nerdfonts # For all my terminal needs.
2020-05-12 19:52:30 +00:00
libertine # nice text font
2020-04-11 20:39:52 +00:00
material-icons # icons in my app
2020-05-12 19:52:30 +00:00
b612; # sans font, very good for displays
2019-07-31 20:36:41 +00:00
};
2019-07-23 17:19:33 +00:00
};
# 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);
2019-09-15 19:10:15 +00:00
in builtins.listToAttrs (lib.imap0 (n: v:
2019-07-31 21:56:52 +00:00
lib.nameValuePair "src-cache/fonts/${toString n}" {
source = builtins.toPath v;
}) font_sources);
2019-07-23 17:19:33 +00:00
}