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" ];
|
2021-06-15 23:21:53 +00:00
|
|
|
serif = [ "Libertinus" "DejaVu Serif" ];
|
2019-07-23 17:19:33 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
enableDefaultFonts = true;
|
2021-01-06 21:41:38 +00:00
|
|
|
#fontDir.enable = true;
|
2019-07-31 20:36:41 +00:00
|
|
|
fonts = builtins.attrValues {
|
|
|
|
inherit (pkgs)
|
2021-05-18 14:33:28 +00:00
|
|
|
nerdfonts# For all my terminal needs.
|
2021-06-15 23:21:53 +00:00
|
|
|
libertinus# nice text font
|
2021-05-18 14:33:28 +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
|
2021-05-18 14:33:28 +00:00
|
|
|
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: v:
|
|
|
|
lib.nameValuePair "src-cache/fonts/${toString n}" {
|
|
|
|
source = builtins.toPath v;
|
|
|
|
})
|
|
|
|
font_sources);
|
2019-07-23 17:19:33 +00:00
|
|
|
}
|