feat(stylix): add enable option

This commit is contained in:
2026-05-22 10:24:58 +02:00
parent a191c89549
commit c3239c544a
3 changed files with 48 additions and 35 deletions

View File

@@ -90,6 +90,7 @@
redis.enable = true; redis.enable = true;
}; };
k8s.enable = true; k8s.enable = true;
my.stylix.enable = true;
git.github.enable = true; git.github.enable = true;
git.gitlab.enable = true; git.gitlab.enable = true;
secrets.vault.enable = true; secrets.vault.enable = true;

View File

@@ -1,30 +1,36 @@
{ {
config, config,
lib,
inputs, inputs,
pkgs, pkgs,
... ...
}: }:
let let
cfg = config.my.stylix;
theme = import ../../../modules/stylix/theme.nix { inherit pkgs; }; theme = import ../../../modules/stylix/theme.nix { inherit pkgs; };
in in
{ {
imports = [ inputs.stylix.homeModules.stylix ]; imports = [ inputs.stylix.homeModules.stylix ];
stylix = { options.my.stylix.enable = lib.mkEnableOption "stylix";
enable = true;
inherit (theme) config = lib.mkIf cfg.enable {
polarity stylix = {
base16Scheme enable = true;
override inherit (theme)
image polarity
; base16Scheme
fonts = { override
monospace = theme.monospaceFont; image
serif = config.stylix.fonts.monospace; ;
sansSerif = config.stylix.fonts.monospace; fonts = {
emoji = config.stylix.fonts.monospace; monospace = theme.monospaceFont;
serif = config.stylix.fonts.monospace;
sansSerif = config.stylix.fonts.monospace;
emoji = config.stylix.fonts.monospace;
};
targets = import ../../../modules/stylix/targets.nix;
}; };
targets = import ../../../modules/stylix/targets.nix;
}; };
} }

View File

@@ -1,36 +1,42 @@
{ {
config, config,
inputs, inputs,
lib,
pkgs, pkgs,
... ...
}: }:
let let
cfg = config.my.stylix;
theme = import ./theme.nix { inherit pkgs; }; theme = import ./theme.nix { inherit pkgs; };
in in
{ {
imports = [ inputs.stylix.nixosModules.stylix ]; imports = [ inputs.stylix.nixosModules.stylix ];
stylix = { options.my.stylix.enable = lib.mkEnableOption "stylix theming";
enable = true;
inherit (theme)
polarity
base16Scheme
override
image
;
fonts = {
monospace = theme.monospaceFont;
serif = config.stylix.fonts.monospace;
sansSerif = config.stylix.fonts.monospace;
emoji = config.stylix.fonts.monospace;
};
autoEnable = true;
};
home-manager.sharedModules = [ config = lib.mkIf cfg.enable {
{ stylix = {
stylix.targets = import ./targets.nix; enable = true;
} inherit (theme)
]; polarity
base16Scheme
override
image
;
fonts = {
monospace = theme.monospaceFont;
serif = config.stylix.fonts.monospace;
sansSerif = config.stylix.fonts.monospace;
emoji = config.stylix.fonts.monospace;
};
autoEnable = true;
};
home-manager.sharedModules = [
{
stylix.targets = import ./targets.nix;
}
];
};
} }