36 lines
1.1 KiB
Nix
36 lines
1.1 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
let inherit (import ../lib) unstable;
|
|
in {
|
|
fonts = {
|
|
fontconfig = {
|
|
enable = true;
|
|
cache32Bit = true;
|
|
defaultFonts = {
|
|
monospace = [ "JetBrainsMono Nerd Font" "DejaVu Sans Mono" ];
|
|
sansSerif = [ "B612" "DejaVu Sans" ];
|
|
serif = [ "Linux Libertine" "DejaVu Serif" ];
|
|
};
|
|
};
|
|
enableDefaultFonts = true;
|
|
enableFontDir = true;
|
|
fonts = builtins.attrValues {
|
|
nerdfonts = unstable.nerdfonts.override {
|
|
fonts = [ "JetBrainsMono" ];
|
|
}; # For all my terminal needs.
|
|
inherit (pkgs)
|
|
libertine # nice text font
|
|
material-icons # icons in my app
|
|
b612; # sans font, very good for displays
|
|
};
|
|
};
|
|
|
|
# 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: v:
|
|
lib.nameValuePair "src-cache/fonts/${toString n}" {
|
|
source = builtins.toPath v;
|
|
}) font_sources);
|
|
}
|