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
|
||||
cfg = config.qt.style.catppuccin;
|
||||
enable =
|
||||
cfg.enable
|
||||
&& config.qt.enable
|
||||
&& lib.elem config.qt.style.name [
|
||||
"kvantum"
|
||||
"Kvantum"
|
||||
];
|
||||
enable = cfg.enable && config.qt.enable;
|
||||
|
||||
flavorCapitalized = lib.ctp.mkUpper cfg.flavor;
|
||||
accentCapitalized = lib.ctp.mkUpper cfg.accent;
|
||||
theme = pkgs.catppuccin-kvantum.override {
|
||||
|
@ -35,7 +30,18 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config.xdg.configFile = lib.mkIf enable {
|
||||
config = lib.mkIf enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = lib.elem config.qt.style.name [
|
||||
"kvantum"
|
||||
"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 = ''
|
||||
|
@ -44,4 +50,5 @@ in
|
|||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue