refactor: font config

This commit is contained in:
2025-10-19 16:21:25 +08:00
parent 090677e101
commit 6bc50deb6a
4 changed files with 48 additions and 68 deletions

View File

@@ -7,6 +7,7 @@
coding.misc.enable = true; coding.misc.enable = true;
coding.langs.lua.enable = true; coding.langs.lua.enable = true;
coding.langs.rust.enable = true; coding.langs.rust.enable = true;
fonts.enable = lib.mkForce false;
persist = { persist = {
enable = true; enable = true;
homeDirs = [ homeDirs = [

View File

@@ -35,40 +35,6 @@
}; };
environment.variables.NIX_REMOTE = "daemon"; environment.variables.NIX_REMOTE = "daemon";
fonts = {
enableDefaultPackages = false;
fontDir.enable = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
jetbrains-mono
nerd-fonts.symbols-only
];
fontconfig.defaultFonts = {
serif = [
"Noto Serif CJK SC"
"Noto Serif"
"Symbols Nerd Font"
];
sansSerif = [
"Noto Sans CJK SC"
"Noto Sans"
"Symbols Nerd Font"
];
monospace = [
"JetBrains Mono"
"Noto Sans Mono CJK SC"
"Symbols Nerd Font Mono"
];
emoji = [ "Noto Color Emoji" ];
};
};
services.printing.enable = true; services.printing.enable = true;
services.upower.enable = true; services.upower.enable = true;

View File

@@ -73,40 +73,6 @@ in
}; };
environment.variables.NIX_REMOTE = "daemon"; environment.variables.NIX_REMOTE = "daemon";
fonts = {
enableDefaultPackages = false;
fontDir.enable = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
jetbrains-mono
nerd-fonts.symbols-only
];
fontconfig.defaultFonts = {
serif = [
"Noto Serif CJK SC"
"Noto Serif"
"Symbols Nerd Font"
];
sansSerif = [
"Noto Sans CJK SC"
"Noto Sans"
"Symbols Nerd Font"
];
monospace = [
"JetBrains Mono"
"Noto Sans Mono CJK SC"
"Symbols Nerd Font Mono"
];
emoji = [ "Noto Color Emoji" ];
};
};
services.printing.enable = true; services.printing.enable = true;
services.keyd = { services.keyd = {

47
modules/fonts.nix Normal file
View File

@@ -0,0 +1,47 @@
{
config,
pkgs,
lib,
...
}:
lib.my.makeSwitch {
inherit config;
default = true;
optionName = "default font settings";
optionPath = [ "fonts" ];
config' = {
fonts = {
enableDefaultPackages = false;
fontDir.enable = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
jetbrains-mono
nerd-fonts.symbols-only
];
fontconfig.defaultFonts = {
serif = [
"Noto Serif CJK SC"
"Noto Serif"
"Symbols Nerd Font"
];
sansSerif = [
"Noto Sans CJK SC"
"Noto Sans"
"Symbols Nerd Font"
];
monospace = [
"JetBrains Mono"
"Noto Sans Mono CJK SC"
"Symbols Nerd Font Mono"
];
emoji = [ "Noto Color Emoji" ];
};
};
};
}