Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(home-manager): add support for kvantum #175

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions modules/home-manager/kvantum.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.qt.style.catppuccin;
enable =
cfg.enable
&& config.qt.enable
&& lib.elem config.qt.style.name [
"kvantum"
"Kvantum"
];
flavorCapitalized = lib.ctp.mkUpper cfg.flavor;
accentCapitalized = lib.ctp.mkUpper cfg.accent;
theme = pkgs.catppuccin-kvantum.override {
accent = accentCapitalized;
variant = flavorCapitalized;
};
themeName = "Catppuccin-${flavorCapitalized}-${accentCapitalized}";
in
Lichthagel marked this conversation as resolved.
Show resolved Hide resolved
{
options.qt.style.catppuccin = 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.xdg.configFile = lib.mkIf enable {
"Kvantum/${themeName}".source = "${theme}/share/Kvantum/${themeName}";
"Kvantum/kvantum.kvconfig" = lib.mkIf cfg.apply {
text = ''
[General]
theme=${themeName}
'';
};
};
}
4 changes: 4 additions & 0 deletions test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ testers.runNixOSTest {

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

qt = enable // {
style.name = "kvantum";
};

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