Skip to content

Commit

Permalink
feat(home-manager): init fcitx5 module (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
pluiedev authored Apr 18, 2024
1 parent 7566389 commit b35a034
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
20 changes: 20 additions & 0 deletions _sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@
},
"version": "bfec91a5d0ab02a73a4615243feb5499d376831c"
},
"fcitx5": {
"cargoLocks": null,
"date": "2022-10-05",
"extract": null,
"name": "fcitx5",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "catppuccin",
"repo": "fcitx5",
"rev": "ce244cfdf43a648d984719fdfd1d60aab09f5c97",
"sha256": "sha256-uFaCbyrEjv4oiKUzLVFzw+UY54/h7wh2cntqeyYwGps=",
"type": "github"
},
"version": "ce244cfdf43a648d984719fdfd1d60aab09f5c97"
},
"fish": {
"cargoLocks": null,
"date": "2023-11-02",
Expand Down
12 changes: 12 additions & 0 deletions _sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@
};
date = "2024-04-07";
};
fcitx5 = {
pname = "fcitx5";
version = "ce244cfdf43a648d984719fdfd1d60aab09f5c97";
src = fetchFromGitHub {
owner = "catppuccin";
repo = "fcitx5";
rev = "ce244cfdf43a648d984719fdfd1d60aab09f5c97";
fetchSubmodules = false;
sha256 = "sha256-uFaCbyrEjv4oiKUzLVFzw+UY54/h7wh2cntqeyYwGps=";
};
date = "2022-10-05";
};
fish = {
pname = "fish";
version = "0ce27b518e8ead555dec34dd8be3df5bd75cff8e";
Expand Down
28 changes: 28 additions & 0 deletions modules/home-manager/fcitx5.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ config
, lib
, sources
, ...
}:
let
inherit (lib) ctp;
cfg = config.i18n.inputMethod.fcitx5.catppuccin;
enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5";
in
{
options.i18n.inputMethod.fcitx5.catppuccin = ctp.mkCatppuccinOpt "Fcitx5";

config = lib.mkIf enable {
assertions = [
(ctp.assertXdgEnabled "Fcitx5")
];

xdg.dataFile."fcitx5/themes/catppuccin-${cfg.flavour}" = {
source = "${sources.fcitx5}/src/catppuccin-${cfg.flavour}";
recursive = true;
};

xdg.configFile."fcitx5/conf/classicui.conf".text = lib.generators.toINIWithGlobalSection { } {
globalSection.Theme = "catppuccin-${cfg.flavour}";
};
};
}
4 changes: 4 additions & 0 deletions nvfetcher.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ fetch.github = "catppuccin/delta"
src.git = "https://github.com/catppuccin/dunst.git"
fetch.github = "catppuccin/dunst"

[fcitx5]
src.git = "https://github.com/catppuccin/fcitx5.git"
fetch.github = "catppuccin/fcitx5"

[fish]
src.git = "https://github.com/catppuccin/fish.git"
fetch.github = "catppuccin/fish"
Expand Down
5 changes: 5 additions & 0 deletions test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ in

manual.manpages.enable = lib.mkDefault false;

i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.catppuccin.enable = true;
};

programs = {
alacritty = ctpEnable;
bat = ctpEnable;
Expand Down

0 comments on commit b35a034

Please sign in to comment.