nixos/modules/services/fontconfig.nix

33 lines
1.1 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
2024-05-08 23:17:20 +08:00
noto-fonts-color-emoji roboto sarasa-gothic source-han-mono wqy_microhei wqy_zenhei noto-fonts-cjk
noto-fonts-emoji
2024-02-26 12:48:49 +08:00
];
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
};
};
2024-03-19 20:01:45 +08:00
nixos.user.sharedModules = [{ config.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".force = true; }];
2023-11-09 22:19:37 +08:00
};
}