refactor: modularize theming

This commit is contained in:
Youwen Wu 2024-12-22 23:26:13 -08:00
parent ddfcbd78c8
commit 4c72a5cb8b
Signed by: youwen
GPG key ID: 865658ED1FE61EC3
5 changed files with 102 additions and 53 deletions

View file

@ -1,19 +1,31 @@
{ pkgs, ... }:
{
fonts = {
enableDefaultPackages = true;
# fontconfig = {
# defaultFonts = {
# serif = [ "Noto Serif" ];
# sansSerif = [ "Noto Sans" ];
# };
# };
packages = with pkgs; [
# noto-fonts
noto-fonts-cjk-sans
# noto-fonts-emoji
# (nerdfonts.override { fonts = [ "CascadiaCode" ]; })
(google-fonts.override { fonts = [ "Lora" ]; })
];
pkgs,
lib,
config,
...
}:
let
cfg = config.liminalOS.system.fonts;
in
{
options.liminalOS.system.fonts = {
enable = lib.mkEnableOption "fonts";
};
config = lib.mkIf cfg.enable {
fonts = {
enableDefaultPackages = true;
packages =
with pkgs;
[
noto-fonts-cjk-sans
(google-fonts.override { fonts = [ "Lora" ]; })
]
++ (lib.optionals (!config.liminalOS.theming.enable) [
noto-fonts
noto-fonts-emoji
nerd-fonts.caskaydia-cove
]);
};
};
}