Files
chiasson-nix/modules/system/fonts.nix
T
2026-05-08 19:05:10 -03:00

70 lines
1.9 KiB
Nix

{ ... }: {
flake.nixosModules.systemFonts = {
config,
lib,
pkgs,
...
}:
let
cfg = config.chiasson.system.fonts;
in
{
options.chiasson.system.fonts = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Bundled fonts + fontconfig defaults.";
};
packages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
nerd-fonts.fira-code
nerd-fonts.droid-sans-mono
nerd-fonts.jetbrains-mono
];
description = "System font packages to install.";
};
defaultFonts = {
monospace = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "FiraCode Nerd Font" "Fira Code" "DejaVu Sans Mono" ];
description = "Default monospace font fallback chain.";
};
sansSerif = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "Noto Sans" "DejaVu Sans" ];
description = "Default sans-serif font fallback chain.";
};
serif = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "Noto Serif" "DejaVu Serif" ];
description = "Default serif font fallback chain.";
};
};
};
config = lib.mkIf cfg.enable {
fonts.packages = cfg.packages;
fonts.fontconfig = {
enable = true;
defaultFonts = {
monospace = cfg.defaultFonts.monospace;
sansSerif = cfg.defaultFonts.sansSerif;
serif = cfg.defaultFonts.serif;
};
};
};
};
}