nixdots/system/roles/workstation/fonts.nix

120 lines
2.4 KiB
Nix
Raw Normal View History

2024-07-26 23:07:07 +00:00
{
pkgs,
lib,
config,
...
}: let
2024-04-13 19:15:25 +00:00
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 {
2024-07-26 23:07:07 +00:00
monospace =
[
"Monaspace Krypton"
"Source Code Pro Medium"
"Source Han Mono"
]
++ common;
2024-04-13 18:10:01 +00:00
2024-07-26 23:07:07 +00:00
sansSerif =
[
"Noto Sans"
"Jost"
"Lexend"
]
++ common;
2024-04-13 18:10:01 +00:00
2024-07-26 23:07:07 +00:00
serif =
[
"Noto Serif"
]
++ common;
2024-04-13 18:10:01 +00:00
2024-07-26 23:07:07 +00:00
emoji =
[
"Noto Color Emoji"
]
++ common;
2024-04-13 19:15:25 +00:00
};
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-06-10 15:59:26 +00:00
monaspace
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
2024-06-20 20:09:27 +00:00
jost
2024-04-13 19:15:25 +00:00
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-06-20 20:09:27 +00:00
material-symbols
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-06-20 21:00:07 +00:00
environment.systemPackages = with pkgs; [
2024-07-26 23:07:07 +00:00
# Tool for searching and previewing installed fonts
font-manager
2024-06-20 21:00:07 +00:00
];
2024-04-13 18:10:01 +00:00
};
}