voidconf/modules/font.nix

106 lines
2.4 KiB
Nix

{ pkgs, config, lib, ... }:
with lib;
let cfg = config.voidconf.fontConfig;
in {
options.voidconf.fontConfig = {
enable = mkEnableOption "Enable opinionated font configuration";
joyPixels = mkEnableOption "Enables the JoyPixels font";
};
config = mkIf cfg.enable {
fonts = {
fontDir.enable = true;
packages = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" "Iosevka" ]; })
baekmuk-ttf
blackout
bqn386
fira
fira-code
font-awesome
iosevka
ipafont
jetbrains-mono
liberation_ttf
libertine
libertinus
mononoki
mplus-outline-fonts.githubRelease
noto-fonts
noto-fonts-emoji
noto-fonts-cjk-sans
noto-fonts-cjk-serif
prociono
ubuntu_font_family
uiua386
vollkorn
];
fontconfig = {
enable = true;
includeUserConf = true;
antialias = true;
hinting.enable = true;
defaultFonts = {
serif = [
"Vollkorn"
"Fira Code"
"IPAMincho"
"Baekmuk Dotum"
"Noto Color Emoji"
];
sansSerif = [
"FiraSans"
"Fira Code"
"IPAGothic"
"Baekmuk Headline"
"Noto Color Emoji"
];
monospace = [
"Iosevka"
"Fira Code"
"JetBrains Mono"
"IPAGothic"
"Baekmuk Dotum"
"Noto Color Emoji"
];
emoji = [ "Noto Color Emoji" (mkIf cfg.joyPixels "JoyPixels") ];
};
localConf = ''
<fontconfig>
<match target="scan">
<test name="family">
<string>APL385 Unicode</string>
</test>
<edit name="spacing">
<int>100</int>
</edit>
</match>
<match target="scan">
<test name="family">
<string>BQN386 Unicode</string>
</test>
<edit name="spacing">
<int>100</int>
</edit>
</match>
<match target="scan">
<test name="family">
<string>Uiua386</string>
</test>
<edit name="spacing">
<int>100</int>
</edit>
</match>
</fontconfig>
'';
};
};
};
}