Skip to content

Commit

Permalink
feat(home-manager): add support for kvantum
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichthagel committed May 17, 2024
1 parent d634461 commit 96fb7dc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions modules/home-manager/kvantum.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ config
, lib
, pkgs
, ...
}:
let
cfg = config.qt.catppuccin-kvantum;
enable = cfg.enable && config.qt.enable;
flavourCapitalized = lib.ctp.mkUpper cfg.flavour;
accentCapitalized = lib.ctp.mkUpper cfg.accent;
theme = pkgs.catppuccin-kvantum.override {
accent = accentCapitalized;
variant = flavourCapitalized;
};
in
{
options.qt.catppuccin-kvantum = lib.ctp.mkCatppuccinOpt "Kvantum" // {
accent = lib.ctp.mkAccentOpt "Kvantum";

apply = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Applies the theme by overwriting `$XDG_CONFIG_HOME/Kvantum/kvantum.kvconfig`.
If this is disabled, you must manually set the theme (e.g. by using `kvantummanager`).
'';
};
};

config = lib.mkIf enable {
qt.style.name = "kvantum";

xdg.configFile = {
"Kvantum/Catppuccin-${flavourCapitalized}-${accentCapitalized}".source = "${theme}/share/Kvantum/Catppuccin-${flavourCapitalized}-${accentCapitalized}";
"Kvantum/kvantum.kvconfig" = lib.mkIf cfg.apply {
text = ''
[General]
theme=Catppuccin-${flavourCapitalized}-${accentCapitalized}
'';
};
};
};
}
2 changes: 2 additions & 0 deletions test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ testers.runNixOSTest {

gtk = lib.recursiveUpdate enable { catppuccin.cursor.enable = true; };

qt = enable;

services = {
dunst = enable;
mako = enable;
Expand Down

0 comments on commit 96fb7dc

Please sign in to comment.