Skip to content

Commit

Permalink
chore(modules): cleanup 24.05 backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo committed Dec 13, 2024
1 parent 9ca6877 commit 46ff763
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
6 changes: 1 addition & 5 deletions modules/home-manager/kitty.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ let
inherit (lib) ctp;
cfg = config.programs.kitty.catppuccin;
enable = cfg.enable && config.programs.kitty.enable;

# TODO: Remove after 24.11 is stable
# https://github.com/nix-community/home-manager/pull/5750
attrName = if (lib.versionAtLeast ctp.getModuleRelease "24.11") then "themeFile" else "theme";
in
{
options.programs.kitty.catppuccin = ctp.mkCatppuccinOpt { name = "kitty"; };

config = lib.mkIf enable { programs.kitty.${attrName} = "Catppuccin-${ctp.mkUpper cfg.flavor}"; };
config = lib.mkIf enable { programs.kitty.themeFile = "Catppuccin-${ctp.mkUpper cfg.flavor}"; };
}
24 changes: 5 additions & 19 deletions modules/home-manager/kvantum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,12 @@ let
cfg = config.qt.style.catppuccin;
enable = cfg.enable && config.qt.enable;

flavorCapitalized = lib.ctp.mkUpper cfg.flavor;
accentCapitalized = lib.ctp.mkUpper cfg.accent;

theme =
if (lib.versionAtLeast lib.ctp.getModuleRelease "24.11") then
pkgs.catppuccin-kvantum.override {
accent = cfg.accent;
variant = cfg.flavor;
}
else
pkgs.catppuccin-kvantum.override {
accent = accentCapitalized;
variant = flavorCapitalized;
};
theme = pkgs.catppuccin-kvantum.override {
inherit (cfg) accent;
variant = cfg.flavor;
};

themeName =
if (lib.versionAtLeast lib.ctp.getModuleRelease "24.11") then
"catppuccin-${cfg.flavor}-${cfg.accent}"
else
"Catppuccin-${flavorCapitalized}-${accentCapitalized}";
themeName = "catppuccin-${cfg.flavor}-${cfg.accent}";
in
{
options.qt.style.catppuccin = lib.ctp.mkCatppuccinOpt { name = "Kvantum"; } // {
Expand Down
5 changes: 2 additions & 3 deletions tests/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ testers.runNixOSTest {
console.enable = true;

i18n.inputMethod = {
# TODO: Use this option after 24.11 is stable
# enable = true;
enabled = "fcitx5";
enable = true;
type = "fcitx5";
};

users.users.test = {
Expand Down

0 comments on commit 46ff763

Please sign in to comment.