nixos/modules/services/fontconfig.nix

32 lines
1.0 KiB
Nix
Raw Normal View History

2023-11-09 22:19:37 +08:00
inputs:
{
options.nixos.services.fontconfig = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
};
config =
let
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos.services) fontconfig;
in mkIf fontconfig.enable
{
fonts =
{
fontDir.enable = true;
2023-11-22 20:12:41 +08:00
packages = with inputs.pkgs;
2024-02-26 12:48:49 +08:00
[
noto-fonts source-han-sans source-han-serif source-code-pro hack-font jetbrains-mono nerdfonts hack-font inter
noto-fonts-color-emoji roboto sarasa-gothic source-han-mono wqy_microhei wqy_zenhei
];
2023-11-09 22:19:37 +08:00
fontconfig.defaultFonts =
{
emoji = [ "Noto Color Emoji" ];
2024-02-26 12:48:49 +08:00
monospace = [ "Hack" "Source Han Mono SC" ];
sansSerif = [ "Inter" "Liberation Sans" "Source Han Sans SC" ];
serif = [ "Liberation Serif" "Source Han Serif SC" ];
2023-11-09 22:19:37 +08:00
};
};
nixos.users.sharedModules = [{ config.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".force = true; }];
2023-11-09 22:19:37 +08:00
};
}