move fontconfig from services to system

This commit is contained in:
2024-05-28 21:43:23 +08:00
parent dc3e9819fd
commit c509149fbe
6 changed files with 29 additions and 36 deletions

View File

@@ -72,7 +72,6 @@ inputs:
services =
{
snapper.enable = true;
fontconfig.enable = true;
samba =
{
enable = true;

View File

@@ -41,7 +41,6 @@ inputs:
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = {};
xray.client = {};
firewall.trustedInterfaces = [ "virbr0" ];

View File

@@ -57,7 +57,6 @@ inputs:
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = { passwordAuthentication = true; groupBanner = true; };
xray.client = {};
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];

View File

@@ -51,7 +51,6 @@ inputs:
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = { passwordAuthentication = true; groupBanner = true; };
xray.client = {};
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];

View File

@@ -1,32 +0,0 @@
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;
packages = with inputs.pkgs;
[
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 noto-fonts-cjk
noto-fonts-emoji
];
fontconfig.defaultFonts =
{
emoji = [ "Noto Color Emoji" ];
monospace = [ "Hack" "Source Han Mono SC" ];
sansSerif = [ "Inter" "Liberation Sans" "Source Han Sans SC" ];
serif = [ "Liberation Serif" "Source Han Serif SC" ];
};
};
nixos.user.sharedModules = [{ config.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".force = true; }];
};
}

View File

@@ -0,0 +1,29 @@
inputs:
{
options.nixos.services.fontconfig = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.services) fontconfig; in inputs.lib.mkIf (fontconfig != null)
{
fonts =
{
fontDir.enable = true;
packages = with inputs.pkgs;
[
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 noto-fonts-cjk
noto-fonts-emoji
];
fontconfig.defaultFonts =
{
emoji = [ "Noto Color Emoji" ];
monospace = [ "Hack" "Source Han Mono SC" ];
sansSerif = [ "Inter" "Liberation Sans" "Source Han Sans SC" ];
serif = [ "Liberation Serif" "Source Han Serif SC" ];
};
};
nixos.user.sharedModules = [{ config.xdg.configFile."fontconfig/conf.d/10-hm-fonts.conf".force = true; }];
};
}