fix(home-manager): assert qt.style.name
for kvantum theme (#242)
while having `qt.enable` be a prerequisite for this option applying makes sense, the requirement on a specific `style.name` is not. this make it more clear by moving that check to an assertion rather than an internal comparison
This commit is contained in:
parent
6e77fdd91d
commit
1adbfeb44a
1 changed files with 21 additions and 14 deletions
|
@ -6,13 +6,8 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.qt.style.catppuccin;
|
cfg = config.qt.style.catppuccin;
|
||||||
enable =
|
enable = cfg.enable && config.qt.enable;
|
||||||
cfg.enable
|
|
||||||
&& config.qt.enable
|
|
||||||
&& lib.elem config.qt.style.name [
|
|
||||||
"kvantum"
|
|
||||||
"Kvantum"
|
|
||||||
];
|
|
||||||
flavorCapitalized = lib.ctp.mkUpper cfg.flavor;
|
flavorCapitalized = lib.ctp.mkUpper cfg.flavor;
|
||||||
accentCapitalized = lib.ctp.mkUpper cfg.accent;
|
accentCapitalized = lib.ctp.mkUpper cfg.accent;
|
||||||
theme = pkgs.catppuccin-kvantum.override {
|
theme = pkgs.catppuccin-kvantum.override {
|
||||||
|
@ -35,13 +30,25 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.xdg.configFile = lib.mkIf enable {
|
config = lib.mkIf enable {
|
||||||
"Kvantum/${themeName}".source = "${theme}/share/Kvantum/${themeName}";
|
assertions = [
|
||||||
"Kvantum/kvantum.kvconfig" = lib.mkIf cfg.apply {
|
{
|
||||||
text = ''
|
assertion = lib.elem config.qt.style.name [
|
||||||
[General]
|
"kvantum"
|
||||||
theme=${themeName}
|
"Kvantum"
|
||||||
'';
|
];
|
||||||
|
message = ''`qt.style.name` must be `"kvantum"` to use `qt.style.catppuccin`'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg.configFile = {
|
||||||
|
"Kvantum/${themeName}".source = "${theme}/share/Kvantum/${themeName}";
|
||||||
|
"Kvantum/kvantum.kvconfig" = lib.mkIf cfg.apply {
|
||||||
|
text = ''
|
||||||
|
[General]
|
||||||
|
theme=${themeName}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue