nixdots/system/roles/workstation/fonts.nix

100 lines
2.1 KiB
Nix
Raw Normal View History

2024-04-13 19:15:25 +00:00
{pkgs, lib, config, ...}: let
inherit (lib) mkIf;
deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop" "desktop"];
in {
config = mkIf (builtins.elem deviceType acceptedTypes) {
fonts = {
enableDefaultPackages = false;
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
fontconfig = {
defaultFonts = let
common = [
"Iosevka Nerd Font"
"Symbols Nerd Font"
"Noto Color Emoji"
];
in {
monospace = [
"Source Code Pro Medium"
"Source Han Mono"
]
++ common;
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
sansSerif = [
"Lexend"
]
++ common;
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
serif = [
"Noto Serif"
]
++ common;
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
emoji = [
"Noto Color Emoji"
]
++ common;
};
2024-04-13 18:10:01 +00:00
};
2024-04-13 19:15:25 +00:00
fontDir = {
enable = true;
decompressFonts = true;
};
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
packages = with pkgs; [
# programming fonts
sarasa-gothic
source-code-pro
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
# desktop fonts
corefonts # MS fonts
b612 # high legibility
material-icons
material-design-icons
roboto
work-sans
comic-neue
source-sans
inter
lato
lexend
dejavu_fonts
noto-fonts
noto-fonts-cjk
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
# emojis
noto-fonts-color-emoji
twemoji-color-font
openmoji-color
openmoji-black
font-awesome
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
# defaults worth keeping
dejavu_fonts
freefont_ttf
gyre-fonts
liberation_ttf
unifont
2024-04-13 18:10:01 +00:00
2024-04-13 19:15:25 +00:00
# specific nerd fonts only
# (installing all nerd fonts is slow and takes gigabytes)
# see: <https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/fonts/nerdfonts/shas.nix>
# for all available fonts
(nerdfonts.override {
fonts = [
"JetBrainsMono"
"Iosevka"
"NerdFontsSymbolsOnly"
"FiraCode"
"FiraMono"
"Hack"
"HeavyData"
];
})
];
};
2024-04-13 18:10:01 +00:00
};
}