feat(stylix): add enable option
This commit is contained in:
@@ -1,36 +1,42 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.my.stylix;
|
||||
theme = import ./theme.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
imports = [ inputs.stylix.nixosModules.stylix ];
|
||||
|
||||
stylix = {
|
||||
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;
|
||||
};
|
||||
options.my.stylix.enable = lib.mkEnableOption "stylix theming";
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
stylix.targets = import ./targets.nix;
|
||||
}
|
||||
];
|
||||
config = lib.mkIf cfg.enable {
|
||||
stylix = {
|
||||
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;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user