Skip to content

Commit

Permalink
feat(home-manager): init fcitx5 module
Browse files Browse the repository at this point in the history
  • Loading branch information
pluiedev committed Apr 18, 2024
1 parent 7566389 commit 0ab023f
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 8 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
27 changes: 27 additions & 0 deletions modules/home-manager/fcitx5.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
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";

assertions = [
(ctp.assertXdgEnabled "Fcitx5")
];

config = lib.mkIf enable {
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
20 changes: 12 additions & 8 deletions test.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ ctp
, inputs
, ...
}:
let
{
ctp,
inputs,
...
}: let
common = {
catppuccin.flavour = "mocha";
users.users.test = {
Expand All @@ -15,11 +15,10 @@ let
enable = true;
catppuccin.enable = true;
};
in
{
in {
name = "module-test";

nodes.machine = { lib, ... }: {
nodes.machine = {lib, ...}: {
imports = [
ctp.nixosModules.catppuccin
inputs.home-manager.nixosModules.default
Expand Down Expand Up @@ -53,6 +52,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 0ab023f

Please sign in to comment.