mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:19:22 +08:00
move fontconfig from services to system
This commit is contained in:
@@ -72,7 +72,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
snapper.enable = true;
|
||||
fontconfig.enable = true;
|
||||
samba =
|
||||
{
|
||||
enable = true;
|
||||
|
||||
@@ -41,7 +41,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
snapper.enable = true;
|
||||
fontconfig.enable = true;
|
||||
sshd = {};
|
||||
xray.client = {};
|
||||
firewall.trustedInterfaces = [ "virbr0" ];
|
||||
|
||||
@@ -57,7 +57,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
snapper.enable = true;
|
||||
fontconfig.enable = true;
|
||||
sshd = { passwordAuthentication = true; groupBanner = true; };
|
||||
xray.client = {};
|
||||
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
|
||||
|
||||
@@ -51,7 +51,6 @@ inputs:
|
||||
services =
|
||||
{
|
||||
snapper.enable = true;
|
||||
fontconfig.enable = true;
|
||||
sshd = { passwordAuthentication = true; groupBanner = true; };
|
||||
xray.client = {};
|
||||
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
|
||||
|
||||
@@ -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; }];
|
||||
};
|
||||
}
|
||||
29
modules/system/fontconfig.nix
Normal file
29
modules/system/fontconfig.nix
Normal 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; }];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user