1
1
Fork 0
nixos/options/custom/settings/fonts.nix

71 lines
1.6 KiB
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.custom.settings.fonts;
in {
options.custom.settings.fonts = {
enable = mkOption {default = false;};
emoji = mkOption {default = "Noto Color Emoji";};
monospace = mkOption {default = "IosevkaTerm NFP SemiBold";};
sans-serif = mkOption {default = "Outfit";};
serif = mkOption {default = "Liberation Serif";};
};
config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Fonts
fonts = {
enableDefaultPackages = true; # Fallback fonts
packages = with pkgs.nerd-fonts;
[
### Monospace
# https://www.nerdfonts.com/#home
#?? kitten choose-fonts
departure-mono
gohufont
iosevka-term
iosevka-term-slab
jetbrains-mono
space-mono
zed-mono
]
++ (with pkgs; [
### Sans Serif
(google-fonts.override {
fonts = [
# Text
"Jost"
"Lexend"
"Outfit"
# Condensed
"Oswald"
# Pixel
"Silkscreen"
];
})
### Other
# Microsoft
corefonts
vistafonts
]);
#?? fc-list --brief | grep family: | sort
fontconfig.defaultFonts = {
emoji = [cfg.emoji];
monospace = [cfg.monospace];
sansSerif = [cfg.sans-serif];
serif = [cfg.serif];
};
};
home-manager.users.${config.custom.username}.fonts.fontconfig.defaultFonts = config.fonts.fontconfig.defaultFonts;
};
}