nixos-config/sets/fonts.nix

119 lines
3.3 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2020-04-11 21:47:33 +00:00
{
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
sansSerif = [ "Inter" ];
# Not really compatible with inter but i'm used to it
monospace = [ "Fira Code" ];
serif = [ "DejaVu Serif" ];
2024-03-02 03:13:17 +00:00
emoji = [
"Noto Color Emoji"
"Noto Emoji"
];
};
localConf = ''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- For some reason websites really want ui font instead of default -->
<match target="pattern">
<test qual="any" name="family">
<string>ui-monospace</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>monospace</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>system-ui</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>BlinkMacSystemFont</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>-apple-system</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<match target="font">
<test name="family">
<string>Inter</string>
</test>
<edit name="fontfeatures" mode="append">
<string>tnum on</string>
<string>ss01 on</string>
<string>ss02 on</string>
</edit>
</match>
<match target="font">
<test name="family">
<string>Fira Code</string>
</test>
<edit name="fontfeatures" mode="append">
<string>cv06 on</string>
<string>ss02 on</string>
<string>ss04 on</string>
</edit>
</match>
</fontconfig>
'';
};
2023-09-10 01:26:43 +00:00
2023-08-30 20:58:52 +00:00
enableDefaultPackages = true;
2024-03-02 03:13:17 +00:00
packages =
with pkgs;
2023-09-10 05:18:56 +00:00
[
corefonts
dejavu_fonts
libertine
ocr-a
2023-09-10 05:18:56 +00:00
source-code-pro
source-sans-pro
source-serif-pro
# Code fonts
fira-code
iosevka
2021-11-12 18:33:13 +00:00
2023-09-10 05:18:56 +00:00
# UI fonts
b612
2024-02-15 23:19:48 +00:00
cantarell-fonts
2023-09-10 05:18:56 +00:00
inter
roboto
# Large multilingual fonts
fira-go
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
2023-09-10 01:26:43 +00:00
2024-02-09 21:05:55 +00:00
# Constructed languages
nasin-nanpa
2023-09-10 05:18:56 +00:00
# Weird symbols
(nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })
2024-03-02 03:13:17 +00:00
]
++ (builtins.attrValues pkgs.extraFonts);
2020-04-11 21:47:33 +00:00
};
}