How do i enable IBUS on nixos with hyprland?

Hey! I use nixos and hyprland, and now that I want to utilize ibus (I use openbangla, which is on the nix package system), how can I do so?

I tried ibus when coming to Hyprland from X, but had issues (forgotten the details). I settled on fcitx5, which works ok (for Chinese and some others at least). Since fctix5 is quite complete and up to date, I guess it should also work with openbangla, but I’ve no specific experience with that.

You can enable it with HM, by doing

  i18n.inputMethod = {
    enabled = "fcitx5";
    fcitx5.addons = with pkgs; [
      fcitx5-gtk
      fcitx5-configtool
      ... 
      fcitx5-m17n
    ];
  };

Though I’m not sure whether openbangla is supposed to be a separate add-on for it, or whether you should install fctix5-with-addons?

There are two programs, openbagla and ibus-avro. How can I enable openbangla for them? Thank you for your guide, but openbangla does not work for it. Perhaps I am missing something.

Although the fcitx5 supports openbagla, it does not function on NixOS. What additional steps must I take? Please advise.

What does not function for you? fcitx5, openbagla or the interaction between the two? If it’s the latter, I’m afraid I won’t be of much help, because I’m not a openbagla user, maybe there are others here?

i’ve set this on my HM, still fcitx5 does not detecting openbangla

i18n.inputMethod = {
    enabled = "fcitx5";
    fcitx5.addons = with pkgs; [
      fcitx5-gtk
      fcitx5-configtool
      fcitx5-with-addons
      fcitx5-m17n
      openbangla-keyboard
    ];
  };

image
I simply want openbangla to be included in this list. Previously, when I was using Arch with ibus, after installing openbangla, it appeared in the bangla section, but it does not appear in fcitx5.

Searching shows that there is [a specific arch package] (AUR (en) - openbangla-keyboard-git) which shows in the PKGBUILD that it specifically enables fcitx.

The package from nixpkgs hardcodes just the ibus dependency.

This likely means that to make it work one would have to “fix” the derivation (package) of openbangla from nixpkgs to build it with fcitx support.

I’m afraid that if nobody has done this before this will be a DIY effort (not too hard but only if you already have some experience), amounting to modifying the package, possibly first via an overlay and then via a PR to nixpkgs.

If you are willing to get into this (steep learning curve but rewarding, when experienced a package modification can take less than an hour) that could be the way. Otherwise you’d probably be better off trying again with ibus (officially it’s supposed to work on wayland I think) and/or filing an issue with the nixpkgs.openbangla maintainer.

I have no idea how to edit or modify a package; could you guide me through it?

I’m not sure why, but it appears that both English and openbangla are unable to detect that on ibus.

Since in this case the changes may be limited to adding fcitx to the ackage function and patching the Cmakelist.txt or adding a -D flag or something, you might as well just modify the package in nixpkgs and file a PR.

How to do this is pretty well documented here.

And until the PR is accepted and merged, you can run your own package “in production” by adding an overlay like so:

nixpkgs.overlays = [
  (final: prev: {
     openbangla = (import 
           (prev.fetchFromGitHub {
              repo = "nixpkgs";
              owner = "yourgithubuser";
              rev = "yourbranch";
              sha256 = "sha256-crKfXyoYUzA6zwMdnor1Aw3DuiT8/PUiwn9zAiArOpg=";
          })
      )
  })
]

(You’ll have to update the sha256 with the expected value which you’ll see in the error message when you try to build it the first time)

i am unable to make it work, so i am installing linux mint on my virtualbox.