Skip to content

Commit

Permalink
feat(home-manager/fcitx5): apply option
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichthagel committed Apr 27, 2024
1 parent a48e70a commit b1b8bfc
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions modules/home-manager/fcitx5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ let
enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5";
in
{
options.i18n.inputMethod.fcitx5.catppuccin = ctp.mkCatppuccinOpt "Fcitx5";
options.i18n.inputMethod.fcitx5.catppuccin = ctp.mkCatppuccinOpt "Fcitx5" // {
apply = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Applies the theme by overwriting `$XDG_CONFIG_HOME/fcitx5/conf/classicui.conf`.
'';
};
};

config = lib.mkIf enable {
assertions = [
Expand All @@ -21,8 +29,10 @@ in
recursive = true;
};

xdg.configFile."fcitx5/conf/classicui.conf".text = lib.generators.toINIWithGlobalSection { } {
globalSection.Theme = "catppuccin-${cfg.flavour}";
};
xdg.configFile."fcitx5/conf/classicui.conf" = lib.mkIf cfg.apply ({
text = lib.generators.toINIWithGlobalSection { } {
globalSection.Theme = "catppuccin-${cfg.flavour}";
};
});
};
}

0 comments on commit b1b8bfc

Please sign in to comment.