How can I get Japanese input, preferably with anthy, to work with either home manager, or configuration.nix? I’m trying all sorts of things, but I’m just not able to get it to work. Right now I am trying home-manager with:
Found the solution (of course just one minute after asking the question) so here it is the trick for those looking it up later:
in fcitx5-config-qt (what I am using), don’t add the Japanese keyboard but simply add the mozc or anthy keyboard. They both work for me, but visually mozc is a little bit nicer because the kanji suggestions of anthy are a bit too small.
I setup a config similar to yours @Infinisil but I’m not seeing mozc in the list of languages.
Here is mine for reference.
{pkgs, ...}: {
config = {
i18n.inputMethod.enabled = "fcitx5";
i18n.inputMethod.fcitx5.addons = [
pkgs.fcitx5-mozc
pkgs.fcitx5-gtk
pkgs.fcitx5-configtool
];
# Would normally set this to fcitx, but kitty only supports ibus, and fcitx
# provides an ibus interface. Can't use ibus for e.g. QT_IM_MODULE though,
# because that at least breaks mumble
environment.variables.GLFW_IM_MODULE = "ibus";
};
}
Ah so I had to reboot before mozc showed up in fcitx5-configtool. I was trying things out with rebuild test but it wasn’t working until I did a rebuild switch and rebooted.
Now the only thing to figure out is why the tab window for alternative kanji isn’t showing up in kitty.
Like others here, I had issues getting fcitx to work, but ibus worked for me. It did introduce issues with plover and my QMK keyboard, so I have the following in my config:
# By default, ibus handles input events asynchronously. This creates the potential for input events at approximately
# the same time to be handled in the wrong order -- for example, when the stenography application Plover emits input
# events after the keys of a chord are lifted, or when rolling home row modifier keys on a QMK-powered keyboard. In
# order to ensure that input events are handled in order, we set IBUS_ENABLE_SYNC_MODE to 1 to force synchronous
# handling of input events by ibus.
i18n.inputMethod = {
enabled = "ibus";
ibus.engines = with pkgs.ibus-engines; [ anthy ];
};
environment.variables = {
IBUS_ENABLE_SYNC_MODE = "1";
};