nixos-config/modules/fonts.nix
Simon Bruder 3d73519a76
Make building without unfree software/assets work
This either removes the packages or replaces them with free packages.
2021-01-03 17:11:22 +01:00

41 lines
1.1 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, lib, pkgs, ... }:
lib.mkIf config.sbruder.gui.enable {
fonts = {
fonts = with pkgs; [
google-fonts # google font collection (free)
lmodern # Latin Modern for non-latex applications
(nerdfonts.override { fonts = [ "Iosevka" ]; })
#roboto # standalone roboto has awful kerning
source-han-sans
source-han-serif # CJK fonts
] ++ lib.optionals config.sbruder.unfree.allowAssets [
corefonts # good ol microsoft fonts
vistafonts # newer microsoft fonts
];
enableDefaultFonts = true;
enableFontDir = true;
fontconfig = {
defaultFonts = {
monospace = [ "Iosevka Nerd Font" "Source Han Sans" ];
sansSerif = [ "Roboto" "Source Han Sans" ];
serif = [ "Georgia" "Source Han Serif" ];
};
localConf = ''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>system-ui</family>
<prefer>
<family>sans-serif</family>
</prefer>
</alias>
</fontconfig>
'';
};
};
}