about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/inputmethods
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/inputmethods')
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/anthy/default.nix19
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/emote/default.nix60
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/evscript/default.nix23
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix29
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix31
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch16
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix113
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix34
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix42
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix34
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix11
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix34
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix38
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch42
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix105
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix14
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix102
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chewing.nix40
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix76
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix62
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix81
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix40
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix40
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-m17n.nix46
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix106
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix53
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix45
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix38
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix38
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix34
-rwxr-xr-xnixpkgs/pkgs/tools/inputmethods/fcitx5/update.py44
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix26
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/footswitch/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile2
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock13
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix12
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/hime/default.nix47
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix57
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch13
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix34
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix68
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix88
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix44
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix65
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix31
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix67
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch31
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix30
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch13
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix62
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus/default.nix174
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch45
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix24
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix64
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/input-remapper/default.nix157
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix24
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix34
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix21
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/kime/default.nix113
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch13
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch45
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix54
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix38
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/lisgd/default.nix51
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix52
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/nabi/default.nix22
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/netevent/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/remote-touchpad/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix80
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix45
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix23
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix76
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix36
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch38
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/uim/default.nix146
-rw-r--r--nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix25
93 files changed, 4303 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix b/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix
new file mode 100644
index 000000000000..23e2da0e41e6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/anthy/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "anthy";
+  version = "9100h";
+
+  meta = with lib; {
+    description = "Hiragana text to Kana Kanji mixed text Japanese input method";
+    homepage    = "https://anthy.osdn.jp/";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms   = platforms.unix;
+  };
+
+  src = fetchurl {
+    url = "mirror://osdn/anthy/37536/anthy-${version}.tar.gz";
+    sha256 = "0ism4zibcsa5nl77wwi12vdsfjys3waxcphn1p5s7d0qy1sz0mnj";
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/emote/default.nix b/nixpkgs/pkgs/tools/inputmethods/emote/default.nix
new file mode 100644
index 000000000000..b2c0fe6cc61c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/emote/default.nix
@@ -0,0 +1,60 @@
+{ lib, fetchFromGitHub, python3Packages, wrapGAppsHook, gobject-introspection, gtk3, keybinder3, xdotool, pango, gdk-pixbuf, atk, librsvg }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "emote";
+  version = "3.0.3";
+
+  src = fetchFromGitHub {
+    owner = "tom-james-watson";
+    repo = "Emote";
+    rev = "v${version}";
+    sha256 = "mqCSl+EGbnL9AfzZT3aa/Y5Rsx433ZmI31BmK3wkaJk=";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "pygobject==3.36.0" "pygobject" \
+      --replace "manimpango==0.3.0" "manimpango"
+    substituteInPlace emote/config.py --replace 'os.environ.get("SNAP")' "'$out/share/emote'"
+    substituteInPlace emote/picker.py --replace 'os.environ.get("SNAP_VERSION", "dev build")' "'$version'"
+    substituteInPlace snap/gui/emote.desktop --replace "Icon=\''${SNAP}/usr/share/icons/emote.svg" "Icon=emote.svg"
+  '';
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+    gobject-introspection
+    keybinder3
+    pango
+    gdk-pixbuf
+    atk
+  ];
+
+  propagatedBuildInputs = [
+    python3Packages.manimpango
+    python3Packages.pygobject3
+    gtk3
+    xdotool
+    librsvg
+  ];
+
+  postInstall = ''
+    install -D snap/gui/emote.desktop $out/share/applications/emote.desktop
+    install -D snap/gui/emote.svg $out/share/pixmaps/emote.svg
+    install -D -t $out/share/emote/static static/{NotoColorEmoji.ttf,emojis.csv,logo.svg,style.css}
+  '';
+
+  dontWrapGApps = true;
+  preFixup = ''
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A modern emoji picker for Linux";
+    homepage = "https://github.com/tom-james-watson/emote";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ emilytrau ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix b/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix
new file mode 100644
index 000000000000..73344ca26900
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/evdevremapkeys/default.nix
@@ -0,0 +1,33 @@
+{ lib, fetchFromGitHub, python3Packages }:
+
+python3Packages.buildPythonPackage rec {
+  pname = "evdevremapkeys";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "philipl";
+    repo = pname;
+    rev = "68fb618b8142e1b45d7a1e19ea9a5a9bbb206144";
+    sha256 = "0c9slflakm5jqd8s1zpxm7gmrrk0335m040d7m70hnsak42jvs2f";
+  };
+
+  propagatedBuildInputs = with python3Packages; [
+    pyyaml
+    pyxdg
+    python-daemon
+    evdev
+  ];
+
+  # hase no tests
+  doCheck = false;
+
+  pythonImportsCheck = [ "evdevremapkeys" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/philipl/evdevremapkeys";
+    description = "Daemon to remap events on linux input devices";
+    license = licenses.mit;
+    maintainers = [ maintainers.q3k ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix b/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix
new file mode 100644
index 000000000000..8afd4804e0ed
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix
@@ -0,0 +1,23 @@
+{ lib, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "evscript";
+  version = "unstable-2021-06-16";
+
+  src = fetchFromGitHub {
+    owner = "unrelentingtech";
+    repo = pname;
+    rev = "25912c0b6446f31b0f64485af3fa4aa8a93b33df";
+    sha256 = "sha256-apq3kHipEX6zOTNwqpIQR46JqmeE7EKVSOGrNNSkyu8=";
+  };
+
+  cargoSha256 = "sha256-1aR9/fhJQ+keRIxSG2cpY1HTalE6nM+MTb1Za3Tot28=";
+
+  meta = with lib; {
+    homepage = "https://github.com/unrelentingtech/evscript";
+    description = "A tiny sandboxed Dyon scripting environment for evdev input devices";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ milesbreslin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix
new file mode 100644
index 000000000000..74553dcebbbb
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-anthy/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, anthy, gettext, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-anthy";
+  version = "0.2.4";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-anthy/${pname}-${version}.tar.xz";
+    sha256 = "sha256-Hxhs2RXuFf/bhczcQ3+Zj+gI3+Z4BEfIzMIfUOUNX7M=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx anthy gettext ];
+
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    description   = "Fcitx Wrapper for anthy";
+    license       = licenses.gpl2Plus;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ ericsagnes ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix
new file mode 100644
index 000000000000..defbe616ab22
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-chewing/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, gettext, libchewing, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-chewing";
+  version = "0.2.3";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-chewing/${pname}-${version}.tar.xz";
+    sha256 = "1w5smp5zvjx681cp1znjypyr9sw5x6v0wnsk8a7ncwxi9q9wf4xk";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx gettext libchewing ];
+
+  preInstall = ''
+   substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+   substituteInPlace data/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-chewing";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-chewing/";
+    description   = "Fcitx engine for chewing";
+    license       = licenses.gpl2;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ ericsagnes ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix
new file mode 100644
index 000000000000..d84407e982b0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-cloudpinyin/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, gettext, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-cloudpinyin";
+  version = "0.3.7";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-cloudpinyin/${pname}-${version}.tar.xz";
+    sha256 = "0ai347wv3qdjzcbh0j9hdjpzwvh2kk57324xbxq37nzagrdgg5x0";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx gettext curl ];
+
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace po/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    description  = "A standalone module for fcitx that uses web API to provide better pinyin result";
+    homepage     = "https://github.com/fcitx/fcitx-cloudpinyin";
+    license      = licenses.gpl3Plus;
+    platforms    = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix
new file mode 100644
index 000000000000..d99a0228e226
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-hangul/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, libhangul, gettext, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-hangul";
+  version = "0.3.1";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-hangul/${pname}-${version}.tar.xz";
+    sha256 = "0ds4071ljq620w7vnprm2jl8zqqkw7qsxvzbjapqak4jarczvmbd";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx libhangul gettext ];
+
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace data/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-hangul";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-hangul/";
+    description   = "Fcitx Wrapper for hangul";
+    license       = licenses.gpl2;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ ericsagnes ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch
new file mode 100644
index 000000000000..84dd5fc8f462
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/datapath.patch
@@ -0,0 +1,16 @@
+--- a/src/utils.cpp
++++ b/src/utils.cpp
+@@ -9,12 +9,7 @@ char* FcitxLibPinyinGetSysPath(LIBPINYIN_LANGUAGE_TYPE type)
+ #ifdef LIBPINYIN_TOOLS_FOUND
+     if (type == LPLT_Simplified) {
+ #endif
+-        /* portable detect here */
+-        if (getenv("FCITXDIR")) {
+-            syspath = fcitx_utils_get_fcitx_path_with_filename("datadir", "libpinyin/data");
+-        } else {
+-            syspath = strdup(LIBPINYIN_PKGDATADIR "/data");
+-        }
++        syspath = strdup(LIBPINYIN_PKGDATADIR "/data");
+ #ifdef LIBPINYIN_TOOLS_FOUND
+     }
+     else {
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix
new file mode 100644
index 000000000000..422b1148d05b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-libpinyin/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, gettext, libpinyin, glib, pcre, dbus, qtwebengine, qtbase, fcitx-qt5 }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-libpinyin";
+  version = "0.5.4";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-libpinyin/${pname}-${version}.tar.xz";
+    sha256 = "1wvsc21imbgq3chlxfw4aycmkb2vi1bkjj9frvhga2m5b5pq82k5";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config  ];
+  buildInputs = [ fcitx-qt5 qtbase qtwebengine.dev fcitx gettext libpinyin glib pcre dbus ];
+
+  # With a typical installation via NixOS option i18n.inputMethod.fcitx.engines,
+  # the FCITXDIR environment variable is set to $out of fcitx-with-plugins,
+  # which leads to an incorrect path for pinyin data.
+  #
+  # It is impossible or difficult to fix this issue without patching. We want
+  # FCITXDIR to point into libpinyin, which is currently not symlinked within
+  # fcitx-with-plugins (only fcitx-libpinyin is symlinked). Also, FCITXDIR
+  # doesn't accept multiple directories.
+  patches = [ ./datapath.patch ];
+
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace data/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace dictmanager/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  preBuild = let
+    ZHUYIN_DATA_FILE_NAME = "model.text.20161206.tar.gz";
+    store_path = fetchurl {
+      url = "https://download.fcitx-im.org/data/${ZHUYIN_DATA_FILE_NAME}";
+      sha256 = "017p11si1b7bkwx36xaybq5a9icq1pd7x1jbymqw92akfgjj8w2w";
+    };
+  in
+    ''
+      cp -rv ${store_path} $NIX_BUILD_TOP/$name/data/${ZHUYIN_DATA_FILE_NAME}
+    '';
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    description  = "Fcitx Wrapper for libpinyin, Library to deal with pinyin";
+    homepage     = "https://github.com/fcitx/fcitx-libpinyin";
+    license      = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms    = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix
new file mode 100644
index 000000000000..31a735559884
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-m17n/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, gettext, m17n_lib, m17n_db, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-m17n";
+  version = "0.2.4";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-m17n/${pname}-${version}.tar.xz";
+    sha256 = "15s52h979xz967f8lm0r0qkplig2w3wjck1ymndbg9kvj25ib0ng";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx gettext m17n_lib m17n_db ];
+
+  preInstall = ''
+    substituteInPlace im/cmake_install.cmake \
+    --replace ${fcitx} $out
+    '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-m17n";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-table-other/";
+    description   = "Fcitx wrapper for m17n";
+    license       = licenses.gpl3Plus;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ ericsagnes ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix
new file mode 100644
index 000000000000..269611f4bd7c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/default.nix
@@ -0,0 +1,113 @@
+{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, gyp, which, ninja,
+  python, pkg-config, protobuf, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese,
+  fcitx, gettext }:
+let
+  japanese_usage_dictionary = fetchFromGitHub {
+    owner  = "hiroyuki-komatsu";
+    repo   = "japanese-usage-dictionary";
+    rev    = "e5b3425575734c323e1d947009dd74709437b684";
+    sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm";
+  };
+  icons = fetchurl {
+    url    = "http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz";
+    sha256 = "10bdjn481jsh32vll7r756l392anz44h6207vjqwby3rplk31np1";
+  };
+in clangStdenv.mkDerivation rec {
+  pname = "fcitx-mozc";
+  version = "2.23.2815.102";
+
+  src = fetchFromGitHub {
+    owner  = "google";
+    repo   = "mozc";
+    rev    = "afb03ddfe72dde4cf2409863a3bfea160f7a66d8";
+    sha256 = "0w2dy2j9x5nc7x3g95j17r3m60vbfyn5j617h7js9xryv33yzpgx";
+  };
+
+  nativeBuildInputs = [ gyp which ninja python pkg-config qt5.wrapQtAppsHook ];
+  buildInputs = [ protobuf gtk2 zinnia qt5.qtbase libxcb fcitx gettext ];
+
+  postUnpack = ''
+    rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/
+    ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary
+    tar -xzf ${icons} -C $sourceRoot/src
+  '';
+
+  patch_version = "${version}.1";
+  patches = [
+    (fetchpatch rec {
+      name   = "fcitx-mozc-${patch_version}.patch";
+      url    = "https://download.fcitx-im.org/fcitx-mozc/${name}";
+      sha256 = "0a8q3vzcbai1ccdrl6qdb81gvbw8aby4lqkl6qs9hg68p6zg42hg";
+     })
+    # https://github.com/google/mozc/pull/444 - fix for gcc8 STL
+    (fetchpatch {
+      url = "https://github.com/google/mozc/commit/82d38f929882a9c62289b179c6fe41efed249987.patch";
+      sha256 = "07cja1b7qfsd3i76nscf1zwiav74h7d6h2g9g2w4bs3h1mc9jwla";
+    })
+    # Support dates after 2019
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/mozc/-/raw/master/debian/patches/add_support_new_japanese_era.patch";
+      sha256 = "1dsiiglrmm8i8shn2hv0j2b8pv6miysjrimj4569h606j4lwmcw2";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace src/unix/fcitx/mozc.conf \
+      --replace "/usr/share/fcitx/mozc/icon/mozc.png" "mozc"
+  '';
+
+  configurePhase = ''
+    export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_fcitx5=0 zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model"
+    cd src && python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc
+  '';
+
+  buildPhase = ''
+    PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \
+      server/server.gyp:mozc_server \
+      gui/gui.gyp:mozc_tool \
+      unix/fcitx/fcitx.gyp:fcitx-mozc
+  '';
+
+  installPhase = ''
+    install -d        $out/share/licenses/fcitx-mozc
+    head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx-mozc/LICENSE
+    install -m 644    data/installer/*.html             $out/share/licenses/fcitx-mozc/
+
+    install -d        $out/share/doc/mozc
+    install -m    644 data/installer/*.html             $out/share/doc/mozc/
+
+    install -D -m 755 out_linux/Release/mozc_server     $out/lib/mozc/mozc_server
+    install    -m 755 out_linux/Release/mozc_tool       $out/lib/mozc/mozc_tool
+
+    wrapQtApp $out/lib/mozc/mozc_tool
+
+    install -D -m 755 out_linux/Release/fcitx-mozc.so   $out/lib/fcitx/fcitx-mozc.so
+    install -D -m 644 unix/fcitx/fcitx-mozc.conf        $out/share/fcitx/addon/fcitx-mozc.conf
+    install -D -m 644 unix/fcitx/mozc.conf              $out/share/fcitx/inputmethod/mozc.conf
+
+    install -d        $out/share/doc/mozc
+
+    for mofile in out_linux/Release/gen/unix/fcitx/po/*.mo
+    do
+      filename=`basename $mofile`
+      lang=$filename.mo
+      install -D -m 644 "$mofile" "$out/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo"
+    done
+
+    install -d        $out/share/fcitx/imicon
+    install    -m 644 fcitx-mozc-icons/mozc.png      $out/share/fcitx/imicon/mozc.png
+    install -d        $out/share/fcitx/mozc/icon
+    install    -m 644 fcitx-mozc-icons/*.png                 $out/share/fcitx/mozc/icon/
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    description   = "Fcitx engine for Google japanese input method";
+    homepage      = "https://github.com/google/mozc";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-mozc/";
+    license       = licenses.free;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ gebner ericsagnes ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix
new file mode 100644
index 000000000000..42c02fe003d7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-rime/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, fcitx, librime, brise, hicolor-icon-theme }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-rime";
+  version = "0.3.2";
+
+  src = fetchurl {
+    url = "https://download.fcitx-im.org/fcitx-rime/${pname}-${version}.tar.xz";
+    sha256 = "0bd8snfa6jr8dhnm0s0z021iryh5pbaf7p15rhkgbigw2pssczpr";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx librime brise hicolor-icon-theme ];
+
+  # cmake cannont automatically find our nonstandard brise install location
+  cmakeFlags = [ "-DRIME_DATA_DIR=${brise}/share/rime-data" ];
+
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+       --replace ${fcitx} $out
+    substituteInPlace data/cmake_install.cmake \
+       --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-rime";
+    downloadPage  = "https://download.fcitx-im.org/fcitx-rime/";
+    description   = "Rime support for Fcitx";
+    license       = licenses.gpl2;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ sifmelcara ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix
new file mode 100644
index 000000000000..c1a1994a9078
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-skk/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, fcitx, libskk, skk-dicts }:
+
+stdenv.mkDerivation {
+  pname = "fcitx-skk";
+  version = "0.1.4";
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx-skk";
+    rev = "f66d0f56a40ff833edbfa68a4be4eaa2e93d0e3d";
+    sha256 = "1yl2syqrk212h26vzzkwl19fyp71inqmsli9411h4n2hbcp6m916";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx libskk skk-dicts ];
+
+  cmakeFlags = [ "-DSKK_DEFAULT_PATH=${skk-dicts}/share/SKK-JISYO.combined"
+                 "-DENABLE_QT=FALSE"
+               ];
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace po/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace data/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    description   = "A SKK style input method engine for fcitx";
+    longDescription = ''
+      Fcitx-skk is an input method engine for fcitx. It is based on libskk and thus
+      provides basic features of SKK Japanese input method such as kana-to-kanji conversion,
+      new word registration, completion, numeric conversion, abbrev mode, kuten input,
+      hankaku-katakana input, and re-conversion.
+    '';
+    license       = licenses.gpl3Plus;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ yuriaisaka ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix
new file mode 100644
index 000000000000..399d426dc3e8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-extra/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-table-extra";
+  version = "0.3.8";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-table-extra/${pname}-${version}.tar.xz";
+    sha256 = "c91bb19c1a7b53c5339bf2f75ae83839020d337990f237a8b9bc0f4416c120ef";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ fcitx gettext ];
+
+  preInstall = ''
+   substituteInPlace tables/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-table-extra";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-table-extra/";
+    description   = "Provides extra table for Fcitx, including Boshiamy, Zhengma, Cangjie, and Quick";
+    license       = licenses.gpl2Plus;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ linc01n ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix
new file mode 100644
index 000000000000..410569b7afbd
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-table-other/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-table-other";
+  version = "0.2.4";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-table-other/${pname}-${version}.tar.xz";
+    sha256 = "1di60lr6l5k2sdwi3yrc0hl89j2k0yipayrsn803vd040w1fgfhq";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ fcitx gettext ];
+
+  preInstall = ''
+   substituteInPlace tables/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-table-other";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-table-other/";
+    description   = "Provides some other tables for Fcitx";
+    license       = licenses.gpl3Plus;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ ericsagnes ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix
new file mode 100644
index 000000000000..5422efb9d38d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-unikey/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, cmake, fcitx, gettext, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-unikey";
+  version = "0.2.5";
+
+  src = fetchurl {
+    url = "http://download.fcitx-im.org/fcitx-unikey/${pname}-${version}.tar.xz";
+    sha256 = "063vc29v7ycaai98v3z4q319sv9sm91my17pmhblw1vifxnw02wf";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fcitx gettext ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-narrowing";
+
+  preInstall = ''
+    substituteInPlace src/cmake_install.cmake \
+      --replace ${fcitx} $out
+    substituteInPlace data/cmake_install.cmake \
+      --replace ${fcitx} $out
+  '';
+
+  meta = with lib; {
+    isFcitxEngine = true;
+    homepage      = "https://github.com/fcitx/fcitx-unikey";
+    downloadPage  = "http://download.fcitx-im.org/fcitx-table-other/";
+    description   = "Fcitx wrapper for unikey";
+    license       = licenses.gpl3Plus;
+    platforms     = platforms.linux;
+    maintainers   = with maintainers; [ ericsagnes ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix
new file mode 100644
index 000000000000..fc28a08b4b79
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/default.nix
@@ -0,0 +1,11 @@
+{ callPackage, plugins ? [] }:
+
+let
+  unwrapped = callPackage ./unwrapped.nix { };
+  wrapped   = callPackage ./wrapper.nix {
+    plugins = plugins;
+    fcitx   = unwrapped;
+  };
+in if plugins == []
+   then unwrapped
+   else wrapped
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix
new file mode 100644
index 000000000000..ccbec8209e9a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-configtool.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, makeWrapper, pkg-config, cmake, fcitx, gtk3, isocodes, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx-configtool";
+  version = "0.4.10";
+
+  meta = with lib; {
+    description = "GTK-based config tool for Fcitx";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cdepillabout ];
+  };
+
+  src = fetchurl {
+    url = "https://download.fcitx-im.org/fcitx-configtool/fcitx-configtool-${version}.tar.xz";
+    sha256 = "1yyi9jhkwn49lx9a47k1zbvwgazv4y4z72gnqgzdpgdzfrlrgi5w";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config makeWrapper ];
+  buildInputs = [ fcitx isocodes gtk3 gnome.adwaita-icon-theme ];
+
+  # Patch paths to `fcitx-remote`
+  prePatch = ''
+    for f in gtk{3,}/config_widget.c; do
+      substituteInPlace $f \
+        --replace 'EXEC_PREFIX "/bin/fcitx-remote"' '"${fcitx}/bin/fcitx-remote"'
+    done
+  '';
+
+  preFixup = ''
+    wrapProgram $out/bin/fcitx-config-gtk3 \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS";
+  '';
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix
new file mode 100644
index 000000000000..391c2c7add2b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/fcitx-qt5.nix
@@ -0,0 +1,38 @@
+{ lib, mkDerivation, fetchFromGitLab
+, cmake
+, extra-cmake-modules
+, fcitx
+, pkg-config
+, qtbase
+}:
+
+mkDerivation rec {
+  pname = "fcitx-qt5";
+  version = "1.2.3";
+
+  src = fetchFromGitLab {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "0860v3rxsh054wkkbawvyin5mk0flp4cwfcpmcpq147lvdm5lq2i";
+  };
+
+  nativeBuildInputs = [ cmake extra-cmake-modules pkg-config ];
+
+  buildInputs = [ fcitx qtbase ];
+
+  preConfigure = ''
+    substituteInPlace platforminputcontext/CMakeLists.txt \
+      --replace \$"{CMAKE_INSTALL_QTPLUGINDIR}" $out/${qtbase.qtPluginPrefix}
+    substituteInPlace quickphrase-editor/CMakeLists.txt \
+      --replace \$"{FCITX4_ADDON_INSTALL_DIR}" $out/lib/fcitx
+  '';
+
+  meta = with lib; {
+    homepage    = "https://gitlab.com/fcitx/fcitx-qt5";
+    description = "Qt5 IM Module for Fcitx";
+    license     = licenses.gpl2;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ ericsagnes ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch b/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
new file mode 100644
index 000000000000..90c9c79aa73d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/find-enchant-lib.patch
@@ -0,0 +1,42 @@
+diff --git a/cmake/FindEnchant.cmake b/cmake/FindEnchant.cmake
+index 7c182e6a..5537595e 100644
+--- a/cmake/FindEnchant.cmake
++++ b/cmake/FindEnchant.cmake
+@@ -16,7 +16,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ endif(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ 
+ find_package(PkgConfig)
+-pkg_check_modules(PC_ENCHANT enchant)
++pkg_check_modules(PC_ENCHANT enchant-2)
+ 
+ find_path(ENCHANT_INCLUDE_DIR
+   NAMES enchant.h
+@@ -24,7 +24,7 @@ find_path(ENCHANT_INCLUDE_DIR
+   PATH_SUFFIXES "enchant")
+ 
+ find_library(ENCHANT_LIBRARIES
+-  NAMES enchant
++  NAMES enchant-2
+   HINTS ${PC_ENCHANT_LIBRARY_DIRS})
+ 
+ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+@@ -39,7 +39,7 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+   #include <stdlib.h>
+   #include <stddef.h>
+   #include <string.h>
+-  #include <enchant/enchant.h>
++  #include <enchant-2/enchant.h>
+ 
+   EnchantBroker *enchant_broker_init();
+   char **enchant_dict_suggest(EnchantDict *dict, const char *str,
+@@ -78,6 +78,10 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
+ endif()
+ 
++if(ENCHANT_API_COMPATIBLE)
++  set(ENCHANT_LIBRARY_FILENAME ${ENCHANT_LIBRARIES})
++endif(ENCHANT_API_COMPATIBLE)
++
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Enchant DEFAULT_MSG ENCHANT_LIBRARIES
+   ENCHANT_INCLUDE_DIR ENCHANT_API_COMPATIBLE)
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix
new file mode 100644
index 000000000000..e9d7f0765b7b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/unwrapped.nix
@@ -0,0 +1,105 @@
+{ lib, stdenv, fetchurl, pkg-config, cmake, intltool, gettext
+, libxml2, enchant2, isocodes, icu, libpthreadstubs
+, pango, cairo, libxkbfile, libXau, libXdmcp, libxkbcommon
+, dbus, gtk2, gtk3, qt4, extra-cmake-modules
+, xkeyboard_config, pcre, libuuid, xorg, makeWrapper
+, withPinyin ? true
+, fetchFromGitLab
+}:
+
+let
+  # releases at http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz
+  # contains all data but if we want to compile from source, we need to
+  # fetch them ourselves
+  # to update the urls and where to unpack these, look into the
+  # src/module/*/data/CMakeLists.txt files
+  # fcitx_download tgt_name url output)
+  dicts = let SPELL_EN_DICT_VER="20121020"; in fetchurl {
+      url = "http://download.fcitx-im.org/data/en_dict-${SPELL_EN_DICT_VER}.tar.gz";
+      sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4";
+  };
+  table = fetchurl {
+      url = "http://download.fcitx-im.org/data/table.tar.gz";
+      sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1";
+  };
+  pystroke-data = let PY_STROKE_VER="20121124"; in fetchurl {
+      url = "http://download.fcitx-im.org/data/py_stroke-${PY_STROKE_VER}.tar.gz";
+      sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf";
+  };
+  pytable-data = let PY_TABLE_VER="20121124"; in fetchurl {
+      url = "http://download.fcitx-im.org/data/py_table-${PY_TABLE_VER}.tar.gz";
+      sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522";
+  };
+  pinyin-data = fetchurl {
+      url = "http://download.fcitx-im.org/data/pinyin.tar.gz";
+      sha256 = "1qfq5dy4czvd1lvdnxzyaiir9x8b1m46jjny11y0i33m9ar2jf2q";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "fcitx";
+  version = "4.2.9.6";
+
+  src = fetchFromGitLab {
+    owner = "fcitx";
+    repo = "fcitx";
+    rev = version;
+    sha256 = "0j5vaf930lb21gx4h7z6mksh1fazqw32gajjjkyir94wbmml9n3s";
+  };
+
+  # put data at the correct locations else cmake tries to fetch them,
+  # which fails in sandboxed mode
+  prePatch = ''
+    cp ${dicts} src/module/spell/dict/$(stripHash ${dicts})
+    cp ${table} src/im/table/data/$(stripHash ${table})
+  ''
+  + lib.optionalString withPinyin ''
+    cp ${pystroke-data} src/module/pinyin-enhance/data/$(stripHash ${pystroke-data})
+    cp ${pytable-data} src/module/pinyin-enhance/data/$(stripHash ${pytable-data})
+    cp ${pinyin-data} src/im/pinyin/data/$(stripHash ${pinyin-data})
+  ''
+  ;
+
+  patches = [ ./find-enchant-lib.patch ];
+
+  postPatch = ''
+    substituteInPlace src/frontend/qt/CMakeLists.txt \
+      --replace $\{QT_PLUGINS_DIR} $out/lib/qt4/plugins
+
+    patchShebangs cmake/
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/fcitx \
+      --prefix PATH : "${xorg.xmodmap}/bin"
+  '';
+
+  nativeBuildInputs = [ cmake extra-cmake-modules intltool pkg-config pcre makeWrapper ];
+
+  buildInputs = [
+    xkeyboard_config enchant2 gettext isocodes icu libpthreadstubs libXau libXdmcp libxkbfile
+    libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_QT_IM_MODULE=ON"
+    "-DENABLE_GTK2_IM_MODULE=ON"
+    "-DENABLE_GTK3_IM_MODULE=ON"
+    "-DENABLE_GIR=OFF"
+    "-DENABLE_OPENCC=OFF"
+    "-DENABLE_PRESAGE=OFF"
+    "-DENABLE_XDGAUTOSTART=OFF"
+    "-DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"}"
+    "-DENABLE_TABLE=ON"
+    "-DENABLE_SPELL=ON"
+    "-DENABLE_QT_GUI=ON"
+    "-DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml'"
+  ];
+
+  meta = with lib; {
+    homepage    = "https://github.com/fcitx/fcitx";
+    description = "A Flexible Input Method Framework";
+    license     = licenses.gpl2;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ ericsagnes ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix
new file mode 100644
index 000000000000..6e7e71c57132
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx/wrapper.nix
@@ -0,0 +1,14 @@
+{ symlinkJoin, fcitx, fcitx-configtool, makeWrapper, plugins, libsForQt5 }:
+
+symlinkJoin {
+  name = "fcitx-with-plugins-${fcitx.version}";
+
+  paths = [ fcitx fcitx-configtool libsForQt5.fcitx-qt5 ] ++ plugins;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/fcitx \
+      --set FCITXDIR "$out/"
+  '';
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix
new file mode 100644
index 000000000000..f00da6045a3c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/default.nix
@@ -0,0 +1,102 @@
+{ lib, stdenv
+, fetchurl
+, fetchFromGitHub
+, pkg-config
+, cmake
+, extra-cmake-modules
+, cairo
+, cldr-emoji-annotation
+, pango
+, fribidi
+, fmt
+, wayland
+, systemd
+, wayland-protocols
+, json_c
+, isocodes
+, xkeyboard_config
+, enchant
+, gdk-pixbuf
+, libGL
+, libevent
+, libuuid
+, libselinux
+, libXdmcp
+, libsepol
+, libxkbcommon
+, libthai
+, libdatrie
+, xcbutilkeysyms
+, pcre
+, xcbutilwm
+, xcb-imdkit
+, libxkbfile
+}:
+let
+  enDictVer = "20121020";
+  enDict = fetchurl {
+    url = "https://download.fcitx-im.org/data/en_dict-${enDictVer}.tar.gz";
+    sha256 = "1svcb97sq7nrywp5f2ws57cqvlic8j6p811d9ngflplj8xw5sjn4";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "fcitx5";
+  version = "5.0.14";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-Trpye+jTu+l8ieUK6IX+ZqNe4H2DvoJ10juiMkEGRKM=";
+  };
+
+  prePatch = ''
+    ln -s ${enDict} src/modules/spell/dict/$(stripHash ${enDict})
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    pkg-config
+  ];
+
+  buildInputs = [
+    fmt
+    isocodes
+    cairo
+    enchant
+    pango
+    libthai
+    libdatrie
+    fribidi
+    systemd
+    gdk-pixbuf
+    wayland
+    wayland-protocols
+    cldr-emoji-annotation
+    json_c
+    libGL
+    libevent
+    libuuid
+    libselinux
+    libsepol
+    libXdmcp
+    libxkbcommon
+    pcre
+    xcbutilwm
+    xcbutilkeysyms
+    xcb-imdkit
+    xkeyboard_config
+    libxkbfile
+  ];
+
+  passthru.updateScript = ./update.py;
+
+  meta = with lib; {
+    description = "Next generation of fcitx";
+    homepage = "https://github.com/fcitx/fcitx5";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chewing.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chewing.nix
new file mode 100644
index 000000000000..7d3ef954b272
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chewing.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, gettext
+, fcitx5
+, libchewing
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-chewing";
+  version = "5.0.9";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-wPfod0BNvNy1gwSJyu7N0sS61StnmXLrMNFgmHk9A0M=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    gettext
+  ];
+
+  buildInputs = [
+    fcitx5
+    libchewing
+  ];
+
+  meta = with lib; {
+    description = "Chewing wrapper for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-chewing";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ xrelkd ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix
new file mode 100644
index 000000000000..7f75748df57b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix
@@ -0,0 +1,76 @@
+{ lib
+, mkDerivation
+, fetchurl
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, boost
+, libime
+, fcitx5
+, fcitx5-qt
+, fcitx5-lua
+, qtwebengine
+, opencc
+, curl
+, fmt
+, luaSupport ? true
+}:
+
+let
+  pyStrokeVer = "20121124";
+  pyStroke = fetchurl {
+    url = "http://download.fcitx-im.org/data/py_stroke-${pyStrokeVer}.tar.gz";
+    sha256 = "0j72ckmza5d671n2zg0psg7z9iils4gyxz7jgkk54fd4pyljiccf";
+  };
+  pyTableVer = "20121124";
+  pyTable = fetchurl {
+    url = "http://download.fcitx-im.org/data/py_table-${pyTableVer}.tar.gz";
+    sha256 = "011cg7wssssm6hm564cwkrrnck2zj5rxi7p9z5akvhg6gp4nl522";
+  };
+in
+
+mkDerivation rec {
+  pname = "fcitx5-chinese-addons";
+  version = "5.0.11";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-PBKTc6yxCaLYZxfR7158rTkR7GsDCapjCKBuLxNu4dU=";
+  };
+
+  cmakeFlags = [
+    "-DUSE_WEBKIT=off"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    boost
+    fcitx5-lua
+  ];
+
+  prePatch = ''
+    ln -s ${pyStroke} modules/pinyinhelper/$(stripHash ${pyStroke})
+    ln -s ${pyTable} modules/pinyinhelper/$(stripHash ${pyTable})
+  '';
+
+  buildInputs = [
+    fcitx5
+    fcitx5-qt
+    libime
+    curl
+    opencc
+    qtwebengine
+    fmt
+  ] ++ lib.optional luaSupport fcitx5-lua;
+
+  meta = with lib; {
+    description = "Addons related to Chinese, including IME previous bundled inside fcitx4";
+    homepage = "https://github.com/fcitx/fcitx5-chinese-addons";
+    license = with licenses; [ gpl2Plus lgpl21Plus ];
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix
new file mode 100644
index 000000000000..42a7ffd0100e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix
@@ -0,0 +1,62 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, fcitx5-qt
+, qtx11extras
+, qtquickcontrols2
+, kwidgetsaddons
+, kdeclarative
+, kirigami2
+, isocodes
+, xkeyboardconfig
+, libxkbfile
+, libXdmcp
+, kcmSupport ? true
+}:
+
+mkDerivation rec {
+  pname = "fcitx5-configtool";
+  version = "5.0.11";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-8Yj4ueLyfPlvjI3HLH5qudY5BEQaBkM5rNgqjH1ihV8=";
+  };
+
+  cmakeFlags = [
+    "-DKDE_INSTALL_USE_QT_SYS_PATHS=ON"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    fcitx5
+    fcitx5-qt
+    qtx11extras
+    qtquickcontrols2
+    kirigami2
+    isocodes
+    xkeyboardconfig
+    libxkbfile
+    libXdmcp
+  ] ++ lib.optionals kcmSupport [
+    kdeclarative
+    kwidgetsaddons
+  ];
+
+  meta = with lib; {
+    description = "Configuration Tool for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-configtool";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix
new file mode 100644
index 000000000000..eaec4463ca59
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, gobject-introspection
+, glib
+, gtk2
+, gtk3
+, gtk4
+, fmt
+, pcre
+, libuuid
+, libselinux
+, libsepol
+, libthai
+, libdatrie
+, libXdmcp
+, libxkbcommon
+, libepoxy
+, dbus
+, at-spi2-core
+, libXtst
+, withGTK2 ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-gtk";
+  version = "5.0.12";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-wSYYVQMuydtxMQ/v9b6bBMesyfKlsqUqpqf/y74Q4zc=";
+  };
+
+  cmakeFlags = [
+    "-DGOBJECT_INTROSPECTION_GIRDIR=share/gir-1.0"
+    "-DGOBJECT_INTROSPECTION_TYPELIBDIR=lib/girepository-1.0"
+  ] ++ lib.optional (! withGTK2) "-DENABLE_GTK2_IM_MODULE=off";
+
+  buildInputs = [
+    glib
+    gtk3
+    gtk4
+    fmt
+    gobject-introspection
+    fcitx5
+    pcre
+    libuuid
+    libselinux
+    libsepol
+    libthai
+    libdatrie
+    libXdmcp
+    libxkbcommon
+    libepoxy
+    dbus
+    at-spi2-core
+    libXtst
+  ] ++ lib.optional withGTK2 gtk2;
+
+  NIX_CFLAGS_COMPILE = lib.concatMapStringsSep " " (s: "-isystem ${s}") [
+    "${glib.dev}/include/gio-unix-2.0"
+    "${glib.dev}/include/glib-2.0"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  meta = with lib; {
+    description = "Fcitx5 gtk im module and glib based dbus client library";
+    homepage = "https://github.com/fcitx/fcitx5-gtk";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix
new file mode 100644
index 000000000000..2357c73b764c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-hangul.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, gettext
+, fcitx5
+, libhangul
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-hangul";
+  version = "5.0.7";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-vjKQ0h85gvlE+inHuzkIBLgluwA6c/XADtyMi6nQNc8=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    gettext
+  ];
+
+  buildInputs = [
+    fcitx5
+    libhangul
+  ];
+
+  meta = with lib; {
+    description = "Hangul wrapper for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-hangul";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ xrelkd ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix
new file mode 100644
index 000000000000..8f53508a0433
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-lua.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, lua5_3
+, luaPackage ? lua5_3
+, gettext
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-lua";
+  version = "5.0.6";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-6znDtU/yVAJByhCanW7KVg5Tk615aCLbFbxDMESVOlY=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    fcitx5
+    luaPackage
+    gettext
+  ];
+
+  meta = with lib; {
+    description = "Lua support for Fcitx 5";
+    homepage = "https://github.com/fcitx/fcitx5-lua";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-m17n.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-m17n.nix
new file mode 100644
index 000000000000..ab2219bfb9a8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-m17n.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, pkg-config
+, fcitx5
+, m17n_lib
+, m17n_db
+, gettext
+, fmt
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-m17n";
+  version = "5.0.8";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-Mh3a7PzfNmGGXzKb/6QUgLmRw7snsM3WSOduFdxj6OM=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    pkg-config
+    gettext
+  ];
+
+  buildInputs = [
+    fcitx5
+    m17n_db
+    m17n_lib
+    fmt
+  ];
+
+  meta = with lib; {
+    description = "m17n support for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-m17n";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ Technical27 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix
new file mode 100644
index 000000000000..57bb0220b312
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-mozc.nix
@@ -0,0 +1,106 @@
+{ lib, clangStdenv, fetchFromGitHub, fetchurl, fetchpatch, fetchgit
+, python3Packages, ninja, pkg-config, protobuf, zinnia, qt5, fcitx5
+, jsoncpp, gtest, which, gtk2, unzip, abseil-cpp, breakpad }:
+let
+  inherit (python3Packages) python gyp six;
+  japanese_usage_dictionary = fetchFromGitHub {
+    owner = "hiroyuki-komatsu";
+    repo = "japanese-usage-dictionary";
+    rev = "e5b3425575734c323e1d947009dd74709437b684";
+    sha256 = "0pyrpz9c8nxccwpgyr36w314mi8h132cis8ijvlqmmhqxwsi30hm";
+  };
+  zipcode_rel = "202011";
+  jigyosyo = fetchurl {
+    url = "https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${zipcode_rel}.zip";
+    sha256 = "j7MkNtd4+QTi91EreVig4/OV0o5y1+KIjEJBEmLK/mY=";
+  };
+  x-ken-all = fetchurl {
+    url =
+      "https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${zipcode_rel}.zip";
+    sha256 = "ExS0Cg3rs0I9IOVbZHLt8UEfk8/LmY9oAHPVVlYuTPw=";
+  };
+
+in clangStdenv.mkDerivation rec {
+  pname = "fcitx5-mozc";
+  version = "2.26.4220.102";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "mozc";
+    rev = "1882e33b61673b66d63277f82b4c80ae4e506c10";
+    sha256 = "R+w0slVFpqtt7PIr1pyupJjRoQsABVZiMdZ9fKGKAqw=";
+  };
+
+  nativeBuildInputs = [ gyp ninja python pkg-config qt5.wrapQtAppsHook six which unzip ];
+
+  buildInputs = [ protobuf zinnia qt5.qtbase fcitx5 abseil-cpp jsoncpp gtest gtk2 ];
+
+  patches = [
+    # Support linking system abseil-cpp
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/mozc/-/raw/debian/sid/debian/patches/0007-Update-src-base-absl.gyp.patch";
+      sha256 = "UiS0UScDKyAusXOhc7Bg8dF8ARQQiVTylEhAOxqaZt8=";
+    })
+
+  ];
+
+  postUnpack = ''
+    unzip ${x-ken-all} -d $sourceRoot/src/
+    unzip ${jigyosyo} -d $sourceRoot/src/
+
+    rmdir $sourceRoot/src/third_party/breakpad/
+    ln -s ${breakpad} $sourceRoot/src/third_party/breakpad
+    rmdir $sourceRoot/src/third_party/gtest/
+    ln -s ${gtest} $sourceRoot/src/third_party/gtest
+    rmdir $sourceRoot/src/third_party/gyp/
+    ln -s ${gyp} $sourceRoot/src/third_party/gyp
+    rmdir $sourceRoot/src/third_party/japanese_usage_dictionary/
+    ln -s ${japanese_usage_dictionary} $sourceRoot/src/third_party/japanese_usage_dictionary
+  '';
+
+  # Copied from https://github.com/archlinux/svntogit-community/blob/packages/fcitx5-mozc/trunk/PKGBUILD
+  configurePhase = ''
+    cd src
+    export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 use_libabseil=1"
+
+    # disable fcitx4
+    rm unix/fcitx/fcitx.gyp
+
+    # gen zip code seed
+    PYTHONPATH="$PWD:$PYTHONPATH" python dictionary/gen_zip_code_seed.py --zip_code="x-ken-all.csv" --jigyosyo="JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt
+
+    # use libstdc++ instead of libc++
+    sed "/stdlib=libc++/d;/-lc++/d" -i gyp/common.gypi
+
+    # run gyp
+    python build_mozc.py gyp --gypdir=${gyp}/bin --server_dir=$out/lib/mozc
+  '';
+
+  buildPhase = ''
+    python build_mozc.py build -c Release \
+      server/server.gyp:mozc_server \
+      gui/gui.gyp:mozc_tool \
+      unix/fcitx5/fcitx5.gyp:fcitx5-mozc
+  '';
+
+  installPhase = ''
+    export PREFIX=$out
+    export _bldtype=Release
+    ../scripts/install_server
+    install -d $out/share/licenses/fcitx5-mozc
+    head -n 29 server/mozc_server.cc > $out/share/licenses/fcitx5-mozc/LICENSE
+    install -m644 data/installer/*.html $out/share/licenses/fcitx5-mozc/
+    install -d $out/share/fcitx5/addon
+    install -d $out/share/fcitx5/inputmethod
+    install -d $out/lib/fcitx5
+    ../scripts/install_fcitx5
+  '';
+
+  meta = with lib; {
+    description = "Fcitx5 Module of A Japanese Input Method for Chromium OS, Windows, Mac and Linux (the Open Source Edition of Google Japanese Input)";
+    homepage = "https://github.com/fcitx/mozc";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ berberman ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix
new file mode 100644
index 000000000000..24e06028a45a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-qt.nix
@@ -0,0 +1,53 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, qtx11extras
+, libxcb
+, libXdmcp
+, qtbase
+}:
+
+mkDerivation rec {
+  pname = "fcitx5-qt";
+  version = "5.0.10";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-KSnbwXMyAnya0Os/xrmjzK/wD6/dpM48rs1nS9SL5hs=";
+  };
+
+  preConfigure = ''
+    substituteInPlace qt5/platforminputcontext/CMakeLists.txt \
+      --replace \$"{CMAKE_INSTALL_QT5PLUGINDIR}" $out/${qtbase.qtPluginPrefix}
+  '';
+
+  cmakeFlags = [
+    "-DENABLE_QT4=0"
+    "-DENABLE_QT6=0"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    fcitx5
+    qtx11extras
+    libxcb
+    libXdmcp
+  ];
+
+  meta = with lib; {
+    description = "Fcitx5 Qt Library";
+    homepage = "https://github.com/fcitx/fcitx5-qt";
+    license = with licenses; [ lgpl21Plus bsd3 ];
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
new file mode 100644
index 000000000000..ecbe4d5c67b4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, cmake
+, extra-cmake-modules
+, gettext
+, fcitx5
+, librime
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-rime";
+  version = "5.0.11";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-kEqooOSLMp2LF911M1q67GYRGx421V6iExXOQk1pcl0=";
+  };
+
+  cmakeFlags = [
+    "-DRIME_DATA_DIR=${placeholder "out"}/share/rime-data"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    pkg-config
+    gettext
+  ];
+
+  buildInputs = [
+    fcitx5
+    librime
+  ];
+
+  meta = with lib; {
+    description = "RIME support for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-rime";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix
new file mode 100644
index 000000000000..fd91a9bafb4a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-extra.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, gettext
+, libime
+, boost
+, fcitx5
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-table-extra";
+  version = "5.0.8";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-8ad7A6MHkVfQEVMrbuAv2sJlc7t3rlz4EFqaMe51YSw=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    gettext
+    libime
+    boost
+    fcitx5
+  ];
+
+  meta = with lib; {
+    description = "Extra table for Fcitx, including Boshiamy, Zhengma, Cangjie, and Quick";
+    homepage = "https://github.com/fcitx/fcitx5-table-extra";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix
new file mode 100644
index 000000000000..dc601aca8060
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-table-other.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, gettext
+, libime
+, boost
+, fcitx5
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-table-other";
+  version = "5.0.7";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-XpQ/5OLNEcJTu1LvGBM6arGZrBl6XSIWx9MDKH9WIt4=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    gettext
+    libime
+    boost
+    fcitx5
+  ];
+
+  meta = with lib; {
+    description = "Some other tables for Fcitx";
+    homepage = "https://github.com/fcitx/fcitx5-table-other";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix
new file mode 100644
index 000000000000..d9517ce214d6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/fcitx5-unikey.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, fcitx5
+, fcitx5-qt
+, gettext
+, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fcitx5-unikey";
+  version = "5.0.8";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "fcitx5-unikey";
+    rev = version;
+    sha256 = "sha256-UdhTIVRLEqzxh9aafqwLhA8EOKiO/tD5QksdVd0rvqI=";
+  };
+
+  nativeBuildInputs = [ cmake extra-cmake-modules wrapQtAppsHook ];
+
+  buildInputs = [ fcitx5 fcitx5-qt gettext ];
+
+  meta = with lib; {
+    description = "Unikey engine support for Fcitx5";
+    homepage = "https://github.com/fcitx/fcitx5-unikey";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ berberman ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py b/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py
new file mode 100755
index 000000000000..205705700404
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i python3 -p nix-update nix-prefetch-github python3Packages.requests
+
+from nix_prefetch_github import *
+import json
+import requests
+import subprocess
+
+REPOS = [
+        "libime",
+        "xcb-imdkit",
+
+        "fcitx5",
+        "fcitx5-chewing",
+        "fcitx5-chinese-addons",
+        "fcitx5-configtool",
+        "fcitx5-gtk",
+        "fcitx5-hangul",
+        "fcitx5-lua",
+        "fcitx5-m17n",
+        "fcitx5-qt",
+        "fcitx5-rime",
+        "fcitx5-table-extra",
+        "fcitx5-table-other",
+        "fcitx5-unikey"
+        ]
+
+OWNER = "fcitx"
+
+def get_latest_tag(repo, owner=OWNER):
+    r = requests.get('https://api.github.com/repos/{}/{}/tags'.format(owner,repo))
+    return r.json()[0].get("name")
+
+def main():
+    sources = dict()
+    for repo in REPOS:
+        rev = get_latest_tag(repo)
+        if repo == "fcitx5-qt":
+            subprocess.run(["nix-update", "--commit", "--version", rev, "libsForQt5.{}".format(repo)])
+        else:
+            subprocess.run(["nix-update", "--commit", "--version", rev, repo])
+
+if __name__ == "__main__":
+    main ()
diff --git a/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix b/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix
new file mode 100644
index 000000000000..020e829f0987
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix
@@ -0,0 +1,26 @@
+{ symlinkJoin, makeWrapper, fcitx5, fcitx5-lua, fcitx5-configtool, fcitx5-qt, fcitx5-gtk, addons ? [] }:
+
+symlinkJoin {
+  name = "fcitx5-with-addons-${fcitx5.version}";
+
+  paths = [ fcitx5 fcitx5-configtool fcitx5-lua fcitx5-qt fcitx5-gtk ] ++ addons;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/fcitx5 \
+      --prefix FCITX_ADDON_DIRS : "$out/lib/fcitx5" \
+      --suffix XDG_DATA_DIRS : "$out/share" \
+      --suffix PATH : "$out/bin"
+
+    desktop=share/applications/org.fcitx.Fcitx5.desktop
+    autostart=etc/xdg/autostart/org.fcitx.Fcitx5.desktop
+    rm $out/$desktop
+    rm $out/$autostart
+    cp ${fcitx5}/$desktop $out/$desktop
+    sed -i $out/$desktop -e "s|^Exec=.*|Exec=$out/bin/fcitx5|g"
+    ln -s $out/$desktop $out/$autostart
+  '';
+
+  meta = fcitx5.meta;
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/footswitch/default.nix b/nixpkgs/pkgs/tools/inputmethods/footswitch/default.nix
new file mode 100644
index 000000000000..9cfdbd393bd9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/footswitch/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, hidapi }:
+
+stdenv.mkDerivation {
+  pname = "footswitch";
+  version = "unstable-20201-03-17";
+
+  src = fetchFromGitHub {
+    owner = "rgerganov";
+    repo = "footswitch";
+    rev = "aa0b10f00d3e76dac27b55b88c8d44c0c406f7f0";
+    sha256 = "sha256-SikYiBN7jbH5I1x5wPCF+buwFp1dt35cVxAN6lWkTN0=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ hidapi ];
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace /usr/local $out \
+      --replace /usr/bin/install install \
+      --replace /etc/udev/rules.d $out/lib/udev/rules.d
+  '';
+
+  preInstall = ''
+    mkdir -p $out/bin $out/lib/udev/rules.d
+  '';
+
+  meta = with lib; {
+    description = "Command line utlities for programming PCsensor and Scythe foot switches.";
+    homepage    = "https://github.com/rgerganov/footswitch";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ baloo ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile
new file mode 100644
index 000000000000..9aa2c3ac71a8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem "fusuma"
diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock
new file mode 100644
index 000000000000..1ca313c6cd54
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/Gemfile.lock
@@ -0,0 +1,13 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    fusuma (1.3.0)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  fusuma
+
+BUNDLED WITH
+   2.1.4
diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix b/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix
new file mode 100644
index 000000000000..dc6d3a09bfa4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/default.nix
@@ -0,0 +1,24 @@
+{ lib, bundlerApp, bundlerUpdateScript, makeWrapper, libinput }:
+
+bundlerApp {
+  pname = "fusuma";
+  gemdir = ./.;
+  exes = [ "fusuma" ];
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram "$out/bin/fusuma" \
+      --prefix PATH : ${lib.makeBinPath [ libinput ]}
+  '';
+
+  passthru.updateScript = bundlerUpdateScript "fusuma";
+
+  meta = with lib; {
+    description = "Multitouch gestures with libinput driver on X11, Linux";
+    homepage = "https://github.com/iberianpig/fusuma";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jfrankenau nicknovitski Br1ght0ne ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix b/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix
new file mode 100644
index 000000000000..87e0ae14da8c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix
@@ -0,0 +1,12 @@
+{
+  fusuma = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "150jc8jyqj3w4k13lf1ihqmm2sld1yawp4jwnf43jixnc9rmzx6f";
+      type = "gem";
+    };
+    version = "1.3.0";
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix b/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix
new file mode 100644
index 000000000000..7506493ee7ce
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/gebaar-libinput/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config, cmake, libinput, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "gebaar-libinput";
+  version = "0.0.5";
+
+  src = fetchFromGitHub {
+    owner = "Coffee2CodeNL";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1kqcgwkia1p195xr082838dvj1gqif9d63i8a52jb0lc32zzizh6";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ pkg-config cmake ];
+  buildInputs = [ libinput zlib ];
+
+  meta = with lib; {
+    description = "Gebaar, A Super Simple WM Independent Touchpad Gesture Daemon for libinput";
+    homepage = "https://github.com/Coffee2CodeNL/gebaar-libinput";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ colemickens lovesegfault ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/hime/default.nix b/nixpkgs/pkgs/tools/inputmethods/hime/default.nix
new file mode 100644
index 000000000000..4c86fb04cf04
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/hime/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchFromGitHub
+, pkg-config
+, which
+, gtk2
+, gtk3
+, qt4
+, qt5
+, libXtst
+, lib
+, libchewing
+, unixtools
+, anthy
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hime";
+  version = "0.9.11";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "hime-ime";
+    rev = "v${version}";
+    sha256 = "sha256-fCqet+foQjI+LpTQ/6Egup1GzXELlL2hgbh0dCKLwPI=";
+  };
+
+  nativeBuildInputs = [ which pkg-config unixtools.whereis ];
+  buildInputs = [ libXtst gtk2 gtk3 qt4 qt5.qtbase libchewing anthy ];
+
+  preConfigure = "patchShebangs configure";
+  configureFlags = [ "--disable-lib64" "--disable-qt5-immodule" ];
+  dontWrapQtApps = true;
+  postFixup = ''
+    hime_rpath=$(patchelf --print-rpath $out/bin/hime)
+    patchelf --set-rpath $out/lib/hime:$hime_rpath $out/bin/hime
+  '';
+
+
+  meta = with lib; {
+    homepage = "http://hime-ime.github.io/";
+    downloadPage = "https://github.com/hime-ime/hime/downloads";
+    description = "A useful input method engine for Asia region";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ yanganto ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
new file mode 100644
index 000000000000..deef4a8f8736
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv
+, fetchurl
+, gettext
+, pkg-config
+, wrapGAppsHook
+, anthy
+, ibus
+, glib
+, gobject-introspection
+, gtk3
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-anthy";
+  version = "1.5.14";
+
+  src = fetchurl {
+    url = "https://github.com/ibus/ibus-anthy/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-yGlNoY0LiRpI9NdaDezjfsvKbRsay2QQGnqEytEEbZs=";
+  };
+
+  buildInputs = [
+    anthy
+    glib
+    gtk3
+    ibus
+    (python3.withPackages (ps: [
+      ps.pygobject3
+      (ps.toPythonModule ibus)
+    ]))
+  ];
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  configureFlags = [
+    "--with-anthy-zipcode=${anthy}/share/anthy/zipcode.t"
+  ];
+
+  postFixup = ''
+    substituteInPlace $out/share/ibus/component/anthy.xml --replace \$\{exec_prefix\} $out
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "IBus interface to the anthy input method";
+    homepage = "https://github.com/fujiwarat/ibus-anthy";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ gebner ericsagnes ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix
new file mode 100644
index 000000000000..0785b7563456
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-bamboo/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, fetchFromGitHub
+, gettext
+, xorg
+, pkg-config
+, wrapGAppsHook
+, ibus
+, gtk3
+, go
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-bamboo";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "BambooEngine";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-WKNDrm8PSU/F8MzpVsJ9oUkbolCxrwbjOZYYNiFr5Qs=";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    pkg-config
+    wrapGAppsHook
+    go
+  ];
+
+  buildInputs = [
+    xorg.libX11
+    xorg.xorgproto
+    xorg.libXtst
+    xorg.libXi
+  ];
+
+  preConfigure = ''
+    export GOCACHE="$TMPDIR/go-cache"
+    sed -i "s,/usr,$out," bamboo.xml
+  '';
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "A Vietnamese IME for IBus";
+    homepage = "https://github.com/BambooEngine/ibus-bamboo";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ superbo ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
new file mode 100644
index 000000000000..af3e1edd6399
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, fetchurl
+, substituteAll
+, appstream-glib
+, gettext
+, pkg-config
+, wrapGAppsHook
+, gtk3
+, ibus
+, libhangul
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-hangul";
+  version = "1.5.4";
+
+  src = fetchurl {
+    url = "https://github.com/choehwanjin/ibus-hangul/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1q6g2pnrn5gqn9jqnm3975v9hh60hc5gn9x3zbrdjgy0n3wpxwm9";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libhangul = "${libhangul}/lib/libhangul.so.1";
+    })
+  ];
+
+  nativeBuildInputs = [
+    appstream-glib
+    gettext
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3
+    ibus
+    libhangul
+    (python3.withPackages (pypkgs: with pypkgs; [
+      pygobject3
+      (toPythonModule ibus)
+    ]))
+  ];
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "Ibus Hangul engine";
+    homepage = "https://github.com/choehwanjin/ibus-hangul";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch
new file mode 100644
index 000000000000..7487d074d559
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/setup/main.py b/setup/main.py
+index 8d581cd..2ac47b9 100644
+--- a/setup/main.py
++++ b/setup/main.py
+@@ -37,7 +37,7 @@
+ 
+ def get_hangul_keyboard_list():
+     from ctypes import CDLL, c_int, c_char_p
+-    libhangul = CDLL('libhangul.so.1')
++    libhangul = CDLL('@libhangul@')
+     libhangul.hangul_ic_get_n_keyboards.argtypes = []
+     libhangul.hangul_ic_get_n_keyboards.restype = c_int
+     libhangul.hangul_ic_get_keyboard_id.argtypes = [c_int]
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix
new file mode 100644
index 000000000000..00ce8df19367
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-kkc/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl
+, vala, intltool, pkg-config
+, libkkc, ibus, skk-dicts
+, gtk3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-kkc";
+  version = "1.5.22";
+
+  src = fetchurl {
+    url = "${meta.homepage}/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "1kj74c9zy9yxkjx7pz96mzqc13cf10yfmlgprr8sfd4ay192bzi2";
+  };
+
+  nativeBuildInputs = [
+    vala intltool pkg-config
+  ];
+
+  buildInputs = [ libkkc ibus skk-dicts gtk3 ];
+
+  postInstall = ''
+    ln -s ${skk-dicts}/share $out/share/skk
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description  = "libkkc (Japanese Kana Kanji input method) engine for ibus";
+    homepage     = "https://github.com/ueno/ibus-kkc";
+    license      = licenses.gpl2;
+    platforms    = platforms.linux;
+    maintainers  = with maintainers; [ vanzef ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix
new file mode 100644
index 000000000000..a81602b3cfee
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libpinyin/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, gettext
+, pkg-config
+, wrapGAppsHook
+, sqlite
+, libpinyin
+, db
+, ibus
+, glib
+, gtk3
+, python3
+, lua
+, opencc
+, libsoup
+, json-glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-libpinyin";
+  version = "1.12.1";
+
+  src = fetchFromGitHub {
+    owner = "libpinyin";
+    repo = "ibus-libpinyin";
+    rev = version;
+    sha256 = "sha256-tSbH4twU+paCZdmzVQMSSg3AzBNkK4nnmOfbvUzvZTk=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gettext
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  configureFlags = [
+    "--enable-cloud-input-mode"
+    "--enable-opencc"
+  ];
+
+  buildInputs = [
+    ibus
+    glib
+    sqlite
+    libpinyin
+    (python3.withPackages (pypkgs: with pypkgs; [
+      pygobject3
+      (toPythonModule ibus)
+    ]))
+    gtk3
+    db
+    lua
+    opencc
+    libsoup
+    json-glib
+  ];
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "IBus interface to the libpinyin input method";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix
new file mode 100644
index 000000000000..c72d7f1a604b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-libthai/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, makeWrapper, pkg-config, ibus, gtk3, libthai }:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-libthai";
+  version = "0.1.5";
+
+  src = fetchurl {
+    url = "https://linux.thai.net/pub/ThaiLinux/software/libthai/ibus-libthai-${version}.tar.xz";
+    sha256 = "sha256-egAxttjwuKiDoIuJluoOTJdotFZJe6ZOmJgdiFCAwx0=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ gtk3 ibus libthai ];
+
+  meta = with lib; {
+    isIbusEngine = true;
+    homepage = "https://linux.thai.net/projects/ibus-libthai";
+    description = "Thai input method engine for IBus";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
new file mode 100644
index 000000000000..aaef2dd2d084
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, ibus
+, gtk3
+, m17n_lib
+, m17n_db
+, gettext
+, python3
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-m17n";
+  version = "1.4.6";
+
+  src = fetchFromGitHub {
+    owner = "ibus";
+    repo = "ibus-m17n";
+    rev = version;
+    sha256 = "sha256-hdm1ObzN9pFLeO1ujobHxiQYnA+dg9zIp/qho6S0H78=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gettext
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    ibus
+    gtk3
+    m17n_lib
+    m17n_db
+    (python3.withPackages (ps: [
+      ps.pygobject3
+      (ps.toPythonModule ibus)
+    ]))
+  ];
+
+  configureFlags = [
+    "--with-gtk=3.0"
+  ];
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "m17n engine for ibus";
+    homepage = "https://github.com/ibus/ibus-m17n";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ericsagnes ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix
new file mode 100644
index 000000000000..44a44b3af2bf
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix
@@ -0,0 +1,88 @@
+{ lib, stdenv, fetchFromGitHub, which, ninja, pkg-config, protobuf
+, ibus, gtk2, zinnia, qt5, libxcb, tegaki-zinnia-japanese, python3Packages }:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-mozc";
+  version = "2.26.4423.100";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "mozc";
+    rev = "7654223979067e3c5ae52ea238d43880c5508f85";
+    sha256 = "aZVuhj4I9ZCsVR9dOplOd9zinYMgYw5SF5wG3IxBTO0=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    which ninja python3Packages.python python3Packages.six
+    python3Packages.gyp pkg-config qt5.wrapQtAppsHook
+  ];
+
+  buildInputs = [ protobuf ibus gtk2 zinnia qt5.qtbase libxcb ];
+
+  postUnpack = lib.optionalString stdenv.isLinux ''
+    sed -i 's/-lc++/-lstdc++/g' $sourceRoot/src/gyp/common.gypi
+  '';
+
+  configurePhase = ''
+    runHook preConfigure
+
+    export GYP_DEFINES="document_dir=$out/share/doc/mozc use_libzinnia=1 use_libprotobuf=1 ibus_mozc_path=$out/lib/ibus-mozc/ibus-engine-mozc zinnia_model_file=${tegaki-zinnia-japanese}/share/tegaki/models/zinnia/handwriting-ja.model"
+    cd src && python build_mozc.py gyp --gypdir=${python3Packages.gyp}/bin --server_dir=$out/lib/mozc
+
+    runHook postConfigure
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    PYTHONPATH="$PWD:$PYTHONPATH" python build_mozc.py build -c Release \
+      unix/ibus/ibus.gyp:ibus_mozc \
+      unix/emacs/emacs.gyp:mozc_emacs_helper \
+      server/server.gyp:mozc_server \
+      gui/gui.gyp:mozc_tool \
+      renderer/renderer.gyp:mozc_renderer
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d        $out/share/licenses/mozc
+    head -n 29 server/mozc_server.cc > $out/share/licenses/mozc/LICENSE
+    install -m 644    data/installer/*.html $out/share/licenses/mozc/
+
+    install -D -m 755 out_linux/Release/mozc_server $out/lib/mozc/mozc_server
+    install    -m 755 out_linux/Release/mozc_tool   $out/lib/mozc/mozc_tool
+    wrapQtApp $out/lib/mozc/mozc_tool
+
+    install -d        $out/share/doc/mozc
+    install -m 644    data/installer/*.html $out/share/doc/mozc/
+
+    install -D -m 755 out_linux/Release/ibus_mozc           $out/lib/ibus-mozc/ibus-engine-mozc
+    install -D -m 644 out_linux/Release/gen/unix/ibus/mozc.xml $out/share/ibus/component/mozc.xml
+    install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png $out/share/ibus-mozc/product_icon.png
+    install    -m 644 data/images/unix/ui-tool.png          $out/share/ibus-mozc/tool.png
+    install    -m 644 data/images/unix/ui-properties.png    $out/share/ibus-mozc/properties.png
+    install    -m 644 data/images/unix/ui-dictionary.png    $out/share/ibus-mozc/dictionary.png
+    install    -m 644 data/images/unix/ui-direct.png        $out/share/ibus-mozc/direct.png
+    install    -m 644 data/images/unix/ui-hiragana.png      $out/share/ibus-mozc/hiragana.png
+    install    -m 644 data/images/unix/ui-katakana_half.png $out/share/ibus-mozc/katakana_half.png
+    install    -m 644 data/images/unix/ui-katakana_full.png $out/share/ibus-mozc/katakana_full.png
+    install    -m 644 data/images/unix/ui-alpha_half.png    $out/share/ibus-mozc/alpha_half.png
+    install    -m 644 data/images/unix/ui-alpha_full.png    $out/share/ibus-mozc/alpha_full.png
+    install -D -m 755 out_linux/Release/mozc_renderer       $out/lib/mozc/mozc_renderer
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "Japanese input method from Google";
+    homepage = "https://github.com/google/mozc";
+    license = licenses.free;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ gebner ericsagnes ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix
new file mode 100644
index 000000000000..d415b6b5a45d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gdk-pixbuf
+, glib
+, ibus
+, libnotify
+, librime
+, pkg-config
+, rime-data
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-rime";
+  version = "1.5.0";
+
+  src = fetchFromGitHub {
+    owner = "rime";
+    repo = "ibus-rime";
+    rev = version;
+    sha256 = "0gdxg6ia0i31jn3cvh1nrsjga1j31hf8a2zfgg8rzn25chrfr319";
+  };
+
+  buildInputs = [ gdk-pixbuf glib ibus libnotify librime rime-data ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  cmakeFlags = [ "-DRIME_DATA_DIR=${rime-data}/share/rime-data" ];
+
+  prePatch = ''
+    substituteInPlace CMakeLists.txt \
+       --replace 'DESTINATION "''${RIME_DATA_DIR}"' \
+                 'DESTINATION "''${CMAKE_INSTALL_DATADIR}/rime-data"'
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "Rime input method engine for IBus";
+    homepage = "https://rime.im/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pmy ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix
new file mode 100644
index 000000000000..40c33aff4011
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-chinese/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, fetchgit, fetchFromGitHub, pkg-config, ibus, ibus-table, python3, cmake }:
+
+let
+  src = fetchFromGitHub {
+    owner = "definite";
+    repo = "ibus-table-chinese";
+    rev = "f1f6a3384f021caa3b84c517e2495086f9c34507";
+    sha256 = "14wpw3pvyrrqvg7al37jk2dxqfj9r4zf88j8k2n2lmdc50f3xs7k";
+  };
+
+  cmakeFedoraSrc = fetchgit {
+    url = "https://pagure.io/cmake-fedora.git";
+    rev = "7d5297759aef4cd086bdfa30cf6d4b2ad9446992";
+    sha256 = "0mx9jvxpiva9v2ffaqlyny48iqr073h84yw8ln43z2avv11ipr7n";
+  };
+in stdenv.mkDerivation {
+  pname = "ibus-table-chinese";
+  version = "1.8.2";
+
+  srcs = [ src cmakeFedoraSrc ];
+  sourceRoot = src.name;
+
+  postUnpack = ''
+    chmod u+w -R ${cmakeFedoraSrc.name}
+    mv ${cmakeFedoraSrc.name}/* source/cmake-fedora
+  '';
+
+  preConfigure = ''
+    # cmake script needs ./Modules folder to link to cmake-fedora
+    ln -s cmake-fedora/Modules ./
+  '';
+
+  # Fails when writing to /prj_info.cmake in https://pagure.io/cmake-fedora/blob/master/f/Modules/ManageVersion.cmake
+  cmakeFlags = [ "-DPRJ_INFO_CMAKE_FILE=/dev/null" "-DPRJ_DOC_DIR=REPLACE" "-DDATA_DIR=share" ];
+  # Must replace PRJ_DOC_DIR with actual share/ folder for ibus-table-chinese
+  # Otherwise it tries to write to /ibus-table-chinese if not defined (!)
+  postConfigure = ''
+    substituteInPlace cmake_install.cmake --replace '/build/source/REPLACE' $out/share/ibus-table-chinese
+  '';
+  # Fails otherwise with "no such file or directory: <table>.txt"
+  dontUseCmakeBuildDir = true;
+  # Fails otherwise sometimes with
+  # FileExistsError: [Errno 17] File exists: '/build/tmp.BfVAUM4llr/ibus-table-chinese/.local/share/ibus-table'
+  enableParallelBuilding = false;
+
+  preBuild = ''
+    export HOME=$(mktemp -d)/ibus-table-chinese
+  '';
+
+  postFixup = ''
+    rm -rf $HOME
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ ibus ibus-table python3 ];
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description  = "Chinese tables for IBus-Table";
+    homepage     = "https://github.com/definite/ibus-table-chinese";
+    license      = licenses.gpl3;
+    platforms    = platforms.linux;
+    maintainers  = with maintainers; [ pneumaticat ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix
new file mode 100644
index 000000000000..18fc21e98088
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, ibus, ibus-table, pkg-config, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-table-others";
+  version = "1.3.12";
+
+  src = fetchurl {
+    url = "https://github.com/moebiuscurve/ibus-table-others/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-2k7JtLr+zO71rbTz11CCiIPx+orn0dw/Y8m47WfRDEU=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ibus ibus-table python3 ];
+
+  preBuild = ''
+    export HOME=$(mktemp -d)/ibus-table-others
+  '';
+
+  postFixup = ''
+    rm -rf $HOME
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description  = "Various table-based input methods for IBus";
+    homepage     = "https://github.com/moebiuscurve/ibus-table-others";
+    license      = licenses.gpl3;
+    platforms    = platforms.linux;
+    maintainers  = with maintainers; [ mudri ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
new file mode 100644
index 000000000000..9712b56b01e1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, docbook2x, pkg-config
+, gtk3, dconf, gobject-introspection
+, ibus, python3, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-table";
+  version = "1.16.7";
+
+  src = fetchFromGitHub {
+    owner  = "kaio";
+    repo   = "ibus-table";
+    rev    = version;
+    sha256 = "sha256-rejYxuRhzNmtx11NH3BZe3ODjU5OyZ9sgk6GWnBBXAo=";
+  };
+
+  postPatch = ''
+    # Data paths will be set at run-time.
+    sed -e "/export IBUS_TABLE_LIB_LOCATION=/ s/^.*$//" \
+        -e "/export IBUS_TABLE_LOCATION=/ s/^.*$//" \
+        -i "engine/ibus-engine-table.in"
+    sed -e "/export IBUS_TABLE_BIN_PATH=/ s/^.*$//" \
+        -e "/export IBUS_TABLE_DATA_DIR=/ s/^.*$//" \
+        -i "engine/ibus-table-createdb.in"
+    sed -e "/export IBUS_PREFIX=/ s/^.*$//" \
+        -e "/export IBUS_DATAROOTDIR=/ s/^.$//" \
+        -e "/export IBUS_LOCALEDIR=/ s/^.$//" \
+        -i "setup/ibus-setup-table.in"
+    substituteInPlace engine/tabcreatedb.py --replace '/usr/share/ibus-table' $out/share/ibus-table
+    substituteInPlace engine/ibus_table_location.py \
+      --replace '/usr/libexec' $out/libexec \
+      --replace '/usr/share/ibus-table/' $out/share/ibus-table/
+  '';
+
+  buildInputs = [
+    dconf
+    gtk3
+    ibus
+    (python3.withPackages (pypkgs: with pypkgs; [
+      dbus-python
+      pygobject3
+      (toPythonModule ibus)
+    ]))
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    docbook2x
+    pkg-config
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  postUnpack = ''
+    substituteInPlace $sourceRoot/engine/Makefile.am \
+      --replace "docbook2man" "docbook2man --sgml"
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description  = "An IBus framework for table-based input methods";
+    homepage     = "https://github.com/kaio/ibus-table/wiki";
+    license      = licenses.lgpl21;
+    platforms    = platforms.linux;
+    maintainers  = with maintainers; [ mudri ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix
new file mode 100644
index 000000000000..1ce947361df9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, python3, ibus, pkg-config, gtk3, m17n_lib
+, wrapGAppsHook, gobject-introspection
+}:
+
+let
+
+  python = python3.withPackages (ps: with ps; [
+    pygobject3
+    dbus-python
+  ]);
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "ibus-typing-booster";
+  version = "2.7.5";
+
+  src = fetchFromGitHub {
+    owner = "mike-fabian";
+    repo = "ibus-typing-booster";
+    rev = version;
+    sha256 = "072mi8r10v78sfs81zxdwfabf87fp872c99c5iral1ywwa4iynpl";
+  };
+
+  patches = [ ./hunspell-dirs.patch ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config wrapGAppsHook gobject-introspection ];
+  buildInputs = [ python ibus gtk3 m17n_lib ];
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${m17n_lib}/lib")
+  '';
+
+  meta = with lib; {
+    homepage = "https://mike-fabian.github.io/ibus-typing-booster/";
+    license = licenses.gpl3Plus;
+    description = "A typing booster engine for the IBus platform";
+    maintainers = with maintainers; [ ];
+    isIbusEngine = true;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch
new file mode 100644
index 000000000000..7b624b379a26
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/hunspell-dirs.patch
@@ -0,0 +1,31 @@
+diff --git a/engine/itb_util.py b/engine/itb_util.py
+index ded236a..633525a 100755
+--- a/engine/itb_util.py
++++ b/engine/itb_util.py
+@@ -1876,14 +1876,18 @@ def find_hunspell_dictionary(language):
+             If no dictionary can be found for the requested language,
+             the return value is ('', '').
+     '''
+-    dirnames = [
+-        '/usr/share/hunspell',
+-        '/usr/share/myspell',
+-        '/usr/share/myspell/dicts',
+-        '/usr/local/share/hunspell', # On FreeBSD the dictionaries are here
+-        '/usr/local/share/myspell',
+-        '/usr/local/share/myspell/dicts',
+-    ]
++
++    if "NIX_HUNSPELL_DIRS" in os.environ:
++        dirnames = os.environ["NIX_HUNSPELL_DIRS"].split(":")
++    else:       # fallback to the original behavior
++        dirnames = [
++            '/usr/share/hunspell',
++            '/usr/share/myspell',
++            '/usr/share/myspell/dicts',
++            '/usr/local/share/hunspell', # On FreeBSD the dictionaries are here
++            '/usr/local/share/myspell',
++            '/usr/local/share/myspell/dicts',
++        ]
+     dic_path = ''
+     aff_path = ''
+     for language in expand_languages([language]):
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix
new file mode 100644
index 000000000000..56ddf93af45f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix
@@ -0,0 +1,30 @@
+{ typing-booster, symlinkJoin, hunspellDicts, lib, makeWrapper
+, langs ? [ "de-de" "en-us" "es-es" "fr-moderne" "it-it" "sv-se" "sv-fi" ]
+}:
+
+let
+
+  hunspellDirs = with lib; makeSearchPath ":" (flatten (forEach langs (lang: [
+    "${hunspellDicts.${lang}}/share/hunspell"
+    "${hunspellDicts.${lang}}/share/myspell"
+    "${hunspellDicts.${lang}}/share/myspell/dicts"
+  ])));
+
+in
+
+symlinkJoin {
+  name = "${typing-booster.name}-with-hunspell";
+  paths = [ typing-booster ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    for i in bin/emoji-picker libexec/ibus-{setup,engine}-typing-booster; do
+      wrapProgram "$out/$i" \
+        --prefix NIX_HUNSPELL_DIRS : ${hunspellDirs}
+    done
+
+    sed -i -e "s,${typing-booster},$out," $out/share/ibus/component/typing-booster.xml
+  '';
+
+  inherit (typing-booster) meta;
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch
new file mode 100644
index 000000000000..434c85d3dbea
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/allow-wrapping.patch
@@ -0,0 +1,13 @@
+diff --git a/uniemoji.xml.in b/uniemoji.xml.in
+index 5fbfd0f..6fb8ad3 100644
+--- a/uniemoji.xml.in
++++ b/uniemoji.xml.in
+@@ -7,7 +7,7 @@
+     <license>GPL</license>
+     <author>Lalo Martins &lt;lalo.martins@gmail.com&gt;</author>
+     <homepage>https://github.com/salty-horse/ibus-uniemoji</homepage>
+-    <exec>@PYTHON@ @DATADIR@/ibus-uniemoji/uniemoji.py --ibus</exec>
++    <exec>@DATADIR@/ibus-uniemoji/uniemoji.py --ibus</exec>
+     <textdomain>uniemoji</textdomain>
+     <engines>
+         <engine>
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
new file mode 100644
index 000000000000..f78d52f5b679
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv
+, fetchFromGitHub
+, gobject-introspection
+, wrapGAppsHook
+, python3
+, ibus
+}:
+
+let
+  python = python3.withPackages (ps: with ps; [
+    pygobject3
+    (toPythonModule ibus)
+    pyxdg
+    python-Levenshtein
+  ]);
+in stdenv.mkDerivation rec {
+  pname = "ibus-uniemoji";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "salty-horse";
+    repo = "ibus-uniemoji";
+    rev = "v${version}";
+    sha256 = "121zh3q0li1k537fcvbd4ns4jgl9bbb9gm9ihy8cfxgirv38lcfa";
+  };
+
+  patches = [
+    # Do not run wrapper script with Python,
+    # the wrapped script will have Python in shebang anyway.
+    ./allow-wrapping.patch
+  ];
+
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    python
+    ibus
+  ];
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "SYSCONFDIR=${placeholder "out"}/etc"
+    "PYTHON=${python.interpreter}"
+  ];
+
+  postFixup = ''
+    wrapGApp $out/share/ibus-uniemoji/uniemoji.py
+  '';
+
+  meta = with lib; {
+    isIbusEngine = true;
+    description = "Input method (ibus) for entering unicode symbols and emoji by name";
+    homepage = "https://github.com/salty-horse/ibus-uniemoji";
+    license = with licenses; [ gpl3 mit ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ aske ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix b/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix
new file mode 100644
index 000000000000..50b9dba51d35
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix
@@ -0,0 +1,174 @@
+{ lib, stdenv
+, substituteAll
+, fetchurl
+, fetchFromGitHub
+, autoreconfHook
+, gettext
+, makeWrapper
+, pkg-config
+, vala
+, wrapGAppsHook
+, dbus
+, dconf ? null
+, glib
+, gdk-pixbuf
+, gobject-introspection
+, gtk2
+, gtk3
+, gtk-doc
+, runCommand
+, isocodes
+, cldr-emoji-annotation
+, unicode-character-database
+, unicode-emoji
+, python3
+, json-glib
+, libnotify ? null
+, enablePython2Library ? false
+, enableUI ? true
+, withWayland ? false
+, libxkbcommon ? null
+, wayland ? null
+, buildPackages
+, runtimeShell
+, nixosTests
+}:
+
+assert withWayland -> wayland != null && libxkbcommon != null;
+
+with lib;
+
+let
+  python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
+  python3BuildEnv = python3.buildEnv.override {
+    # ImportError: No module named site
+    postBuild = ''
+      makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH
+      makeWrapper ${glib.dev}/bin/glib-genmarshal $out/bin/glib-genmarshal --unset PYTHONPATH
+      makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
+    '';
+  };
+  # make-dconf-override-db.sh needs to execute dbus-launch in the sandbox,
+  # it will fail to read /etc/dbus-1/session.conf unless we add this flag
+  dbus-launch = runCommand "sandbox-dbus-launch" {
+    nativeBuildInputs = [ makeWrapper ];
+  } ''
+      makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \
+        --add-flags --config-file=${dbus.daemon}/share/dbus-1/session.conf
+  '';
+in
+
+stdenv.mkDerivation rec {
+  pname = "ibus";
+  version = "1.5.24";
+
+  src = fetchFromGitHub {
+    owner = "ibus";
+    repo = "ibus";
+    rev = version;
+    sha256 = "sha256-1qx06MlEUjSS067FdQG1Bdi4ZAh3hPcNjUX5PIiC3Sk=";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      pythonInterpreter = python3Runtime.interpreter;
+      pythonSitePackages = python3.sitePackages;
+    })
+  ];
+
+  outputs = [ "out" "dev" "installedTests" ];
+
+  postPatch = ''
+    patchShebangs --build data/dconf/make-dconf-override-db.sh
+    cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
+  '';
+
+  preAutoreconf = "touch ChangeLog";
+
+  configureFlags = [
+    "--disable-memconf"
+    (enableFeature (dconf != null) "dconf")
+    (enableFeature (libnotify != null) "libnotify")
+    (enableFeature withWayland "wayland")
+    (enableFeature enablePython2Library "python-library")
+    (enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway
+    (enableFeature enableUI "ui")
+    "--enable-install-tests"
+    "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji"
+    "--with-emoji-annotation-dir=${cldr-emoji-annotation}/share/unicode/cldr/common/annotations"
+    "--with-ucd-dir=${unicode-character-database}/share/unicode"
+  ];
+
+  makeFlags = [
+    "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus"
+    "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus"
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gtk-doc
+    gettext
+    makeWrapper
+    pkg-config
+    python3BuildEnv
+    vala
+    wrapGAppsHook
+    dbus-launch
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  buildInputs = [
+    dbus
+    dconf
+    gdk-pixbuf
+    gobject-introspection
+    python3.pkgs.pygobject3 # for pygobject overrides
+    gtk2
+    gtk3
+    isocodes
+    json-glib
+    libnotify
+  ] ++ optionals withWayland [
+    libxkbcommon
+    wayland
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = false; # requires X11 daemon
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/ibus version
+  '';
+
+  postInstall = ''
+    # It has some hardcoded FHS paths and also we do not use it
+    # since we set up the environment in NixOS tests anyway.
+    moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests"
+  '';
+
+  postFixup = ''
+    # set necessary environment also for tests
+    for f in $installedTests/libexec/installed-tests/ibus/*; do
+        wrapGApp $f
+    done
+  '';
+
+  passthru = {
+    tests = {
+      installed-tests = nixosTests.installed-tests.ibus;
+    };
+  };
+
+  meta = {
+    homepage = "https://github.com/ibus/ibus";
+    description = "Intelligent Input Bus, input method framework";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ttuegel yana ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch b/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch
new file mode 100644
index 000000000000..60269c6c2418
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus/fix-paths.patch
@@ -0,0 +1,45 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -429,11 +429,11 @@
+ if test "x$enable_pygobject" = "xyes"; then
+     PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
+ 
+-    pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"`
++    pyoverridesdir="$prefix/@pythonSitePackages@/gi/overrides"
+     AC_SUBST(pyoverridesdir)
+ 
+     if test x"$enable_python2" = x"yes"; then
+-        py2overridesdir=`$PYTHON2 -c "import gi; print(gi._overridesdir)"`
++        py2overridesdir="$prefix/@pythonSitePackages@/gi/overrides"
+         AC_SUBST(py2overridesdir)
+     fi
+ fi
+@@ -462,7 +462,7 @@
+     PYTHON2_VERSION=`$PYTHON2 -c "import sys; sys.stdout.write(sys.version[[:3]])"`
+     PYTHON2_LIBDIR="$PYTHON2_PREFIX/lib/python$PYTHON2_VERSION"
+     python2dir="$PYTHON2_LIBDIR/site-packages"
+-    pkgpython2dir="$python2dir/ibus"
++    pkgpython2dir="$prefix/@pythonSitePackages@/ibus"
+     AC_SUBST(pkgpython2dir)
+ else
+     enable_python_library="no (disabled, use --enable-python-library to enable)"
+--- a/data/dconf/Makefile.am
++++ b/data/dconf/Makefile.am
+@@ -50,7 +50,7 @@
+ 
+ install-data-hook:
+ 	if test -z "$(DESTDIR)"; then \
+-	    dconf update; \
++	    true; \
+ 	fi
+ 
+ EXTRA_DIST = \
+--- a/setup/ibus-setup.in
++++ b/setup/ibus-setup.in
+@@ -27,5 +27,5 @@
+ export IBUS_DATAROOTDIR=@datarootdir@
+ export IBUS_LOCALEDIR=@localedir@
+ export IBUS_LIBEXECDIR=${libexecdir}
+-exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py $@
++exec @pythonInterpreter@ @prefix@/share/ibus/setup/main.py $@
+ 
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix b/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix
new file mode 100644
index 000000000000..4f6a4e1bef3e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus/ibus-qt.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, ibus, cmake, pkg-config, qt4, icu, doxygen }:
+
+stdenv.mkDerivation rec {
+  pname = "ibus-qt";
+  version = "1.3.3";
+
+  src = fetchurl {
+    url = "https://github.com/ibus/ibus-qt/releases/download/${version}/${pname}-${version}-Source.tar.gz";
+    sha256 = "1q9g7qghpcf07valc2ni7yf994xqx2pmdffknj7scxfidav6p19g";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config doxygen ];
+  buildInputs = [ ibus qt4 icu ];
+
+  cmakeFlags = [ "-DQT_PLUGINS_DIR=lib/qt4/plugins" ];
+
+  meta = with lib; {
+    homepage    = "https://github.com/ibus/ibus-qt/";
+    description = "Qt4 interface to the ibus input method";
+    platforms   = platforms.linux;
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix b/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix
new file mode 100644
index 000000000000..93078325a0d2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/ibus/wrapper.nix
@@ -0,0 +1,64 @@
+{ lib, runCommand, makeWrapper, lndir
+, dconf, hicolor-icon-theme, ibus, librsvg, plugins ? []
+}:
+
+let
+  name = "ibus-with-plugins-" + lib.getVersion ibus;
+  env = {
+    buildInputs = [ ibus ] ++ plugins;
+    nativeBuildInputs = [ lndir makeWrapper ];
+    propagatedUserEnvPackages = [ hicolor-icon-theme ];
+    paths = [ ibus ] ++ plugins;
+    inherit (ibus) meta;
+  };
+  command = ''
+    for dir in bin etc lib libexec share; do
+        mkdir -p "$out/$dir"
+        for pkg in $paths; do
+            if [ -d "$pkg/$dir" ]; then
+                lndir -silent "$pkg/$dir" "$out/$dir"
+            fi
+        done
+    done
+
+    for prog in ibus; do
+        wrapProgram "$out/bin/$prog" \
+          --set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
+          --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
+          --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
+          --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \
+          --set IBUS_DATAROOTDIR "$out/share" \
+          --set IBUS_LIBEXECDIR "$out/libexec" \
+          --set IBUS_LOCALEDIR "$out/share/locale" \
+          --set IBUS_PREFIX "$out" \
+          --set IBUS_TABLE_BIN_PATH "$out/bin" \
+          --set IBUS_TABLE_DATA_DIR "$out/share" \
+          --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \
+          --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \
+          --prefix PYTHONPATH : "$PYTHONPATH" \
+          --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
+          --suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share"
+    done
+
+    for prog in ibus-daemon; do
+        wrapProgram "$out/bin/$prog" \
+          --set GDK_PIXBUF_MODULE_FILE ${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
+          --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
+          --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
+          --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \
+          --set IBUS_DATAROOTDIR "$out/share" \
+          --set IBUS_LIBEXECDIR "$out/libexec" \
+          --set IBUS_LOCALEDIR "$out/share/locale" \
+          --set IBUS_PREFIX "$out" \
+          --set IBUS_TABLE_BIN_PATH "$out/bin" \
+          --set IBUS_TABLE_DATA_DIR "$out/share" \
+          --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \
+          --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \
+          --prefix PYTHONPATH : "$PYTHONPATH" \
+          --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
+          --suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
+          --add-flags "--cache=refresh"
+    done
+  '';
+in
+  runCommand name env command
diff --git a/nixpkgs/pkgs/tools/inputmethods/input-remapper/default.nix b/nixpkgs/pkgs/tools/inputmethods/input-remapper/default.nix
new file mode 100644
index 000000000000..82664c3700e2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/input-remapper/default.nix
@@ -0,0 +1,157 @@
+{ lib
+, python3
+, pkgconfig
+, wrapGAppsHook
+, gettext
+, gtk3
+, glib
+, dbus
+, gobject-introspection
+, xmodmap
+, pygobject3
+, setuptools
+, evdev
+, pydantic
+, pydbus
+, psutil
+, fetchFromGitHub
+, buildPythonApplication
+, procps
+, gtksourceview4
+  # Change the default log level to debug for easier debugging of package issues
+, withDebugLogLevel ? false
+  # Xmodmap is an optional dependency
+  # If you use Xmodmap to set keyboard mappings (or your DE does)
+  # it is required to correctly map keys
+, withXmodmap ? true
+  # Version and rev and hash are package arguments to allow overriding
+  # while ensuring the values in prePatch and src match
+  # https://discourse.nixos.org/t/avoid-rec-expresions-in-nixpkgs/8293/7
+  # The names are prefixed with input_remapper to avoid potential
+  # collisions with package names
+, input_remapper_version ? "unstable-2022-02-09"
+, input_remapper_src_rev ? "55227e0b5a28d21d7333c6c8ea1c691e56fd35c4"
+, input_remapper_src_hash ? "sha256-kzGlEaYN/JfAgbI0aMLr5mwObYOL43X7QU/ihDEBQFg="
+}:
+
+let
+  maybeXmodmap = lib.optional withXmodmap xmodmap;
+in
+buildPythonApplication {
+  pname = "input-remapper";
+  version = input_remapper_version;
+
+  src = fetchFromGitHub {
+    rev = input_remapper_src_rev;
+    owner = "sezanzeb";
+    repo = "input-remapper";
+    hash = input_remapper_src_hash;
+  };
+
+  # Fixes error
+  # Couldn’t recognize the image file format for file "*.svg"
+  # at startup, see https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  prePatch = ''
+    # set revision for --version output
+    echo "COMMIT_HASH = '${input_remapper_src_rev}'" > inputremapper/commit_hash.py
+
+    # fix FHS paths
+    substituteInPlace inputremapper/configs/data.py \
+      --replace "/usr/share/input-remapper"  "$out/usr/share/input-remapper"
+  '' + (lib.optionalString (withDebugLogLevel) ''
+    # if debugging
+    substituteInPlace inputremapper/logger.py --replace "logger.setLevel(logging.INFO)"  "logger.setLevel(logging.DEBUG)"
+  '');
+
+  doCheck = true;
+  checkInputs = [
+    psutil
+  ];
+  pythonImportsCheck = [
+    "evdev"
+    "inputremapper"
+  ];
+
+  # Custom test script, can't use plain pytest / pytestCheckHook
+  # We only run tests in the unit folder, integration tests require UI
+  # To allow tests which access the system and session DBUS to run, we start a dbus session
+  # and bind it to both the system and session buses
+  installCheckPhase = ''
+    echo "<busconfig>
+      <type>session</type>
+      <listen>unix:tmpdir=$TMPDIR</listen>
+      <listen>unix:path=/build/system_bus_socket</listen>
+      <standard_session_servicedirs/>
+      <policy context=\"default\">
+        <!-- Allow everything to be sent -->
+        <allow send_destination=\"*\" eavesdrop=\"true\"/>
+        <!-- Allow everything to be received -->
+        <allow eavesdrop=\"true\"/>
+        <!-- Allow anyone to own anything -->
+        <allow own=\"*\"/>
+      </policy>
+    </busconfig>" > dbus.cfg
+    PATH=${lib.makeBinPath ([ dbus procps ] ++ maybeXmodmap)}:$PATH \
+      USER="$(id -u -n)" \
+      DBUS_SYSTEM_BUS_ADDRESS=unix:path=/build/system_bus_socket \
+      ${dbus}/bin/dbus-run-session --config-file dbus.cfg \
+      python tests/test.py --start-dir unit
+  '';
+
+  # Nixpkgs 15.9.4.3. When using wrapGAppsHook with special derivers you can end up with double wrapped binaries.
+  dontWrapGApps = true;
+  preFixup = ''
+    makeWrapperArgs+=(
+      "''${gappsWrapperArgs[@]}"
+      --prefix PATH : "${lib.makeBinPath maybeXmodmap}"
+    )
+  '';
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+    gettext # needed to build translations
+    gtk3
+    glib
+    gobject-introspection
+    pygobject3
+  ] ++ maybeXmodmap;
+
+  propagatedBuildInputs = [
+    setuptools # needs pkg_resources
+    pygobject3
+    evdev
+    pkgconfig
+    pydantic
+    pydbus
+    gtksourceview4
+  ];
+
+  postInstall = ''
+    sed -r "s#RUN\+\=\"/bin/input-remapper-control#RUN\+\=\"$out/bin/input-remapper-control#g" -i data/99-input-remapper.rules
+    sed -r "s#ExecStart\=/usr/bin/input-remapper-service#ExecStart\=$out/bin/input-remapper-service#g" -i data/input-remapper.service
+
+    chmod +x data/*.desktop
+
+    install -D -t $out/share/applications/ data/*.desktop
+    install -D -t $out/share/polkit-1/actions/ data/input-remapper.policy
+    install -D data/99-input-remapper.rules $out/etc/udev/rules.d/99-input-remapper.rules
+    install -D data/input-remapper.service $out/lib/systemd/system/input-remapper.service
+    install -D data/input-remapper.policy $out/share/polkit-1/actions/input-remapper.policy
+    install -D data/inputremapper.Control.conf $out/etc/dbus-1/system.d/inputremapper.Control.conf
+    install -D -t $out/usr/share/input-remapper/ data/*
+
+    # Only install input-remapper prefixed binaries, we don't care about deprecated key-mapper ones
+    install -m755 -D -t $out/bin/ bin/input-remapper*
+  '';
+
+  meta = with lib; {
+    description = "An easy to use tool to change the mapping of your input device buttons";
+    homepage = "https://github.com/sezanzeb/input-remapper";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ LunNova ];
+    mainProgram = "input-remapper-gtk";
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix b/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix
new file mode 100644
index 000000000000..933a731828fb
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/caps2esc.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitLab, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "caps2esc";
+  version = "0.3.2";
+
+  src = fetchFromGitLab {
+    group = "interception";
+    owner = "linux/plugins";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-gPFElAixiDTTwcl2XKM7MbTkpRrg8ToO5K7H8kz3DHk=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.com/interception/linux/plugins/caps2esc";
+    description = "Transforming the most useless key ever into the most useful one";
+    license = licenses.mit;
+    maintainers = [ maintainers.vyp ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix b/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix
new file mode 100644
index 000000000000..5d5bd7bdfc2b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, cmake, libyamlcpp,
+  libevdev, udev, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "interception-tools";
+  version = "0.6.8";
+  src = fetchFromGitLab {
+    owner = "interception/linux";
+    repo = "tools";
+    rev = "v${version}";
+    sha256 = "sha256-jhdgfCWbkF+jD/iXsJ+fYKOtPymxcC46Q4w0aqpvcek=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libevdev udev libyamlcpp boost ];
+
+  meta = {
+    description = "A minimal composable infrastructure on top of libudev and libevdev";
+    homepage = "https://gitlab.com/interception/linux/tools";
+    license = lib.licenses.gpl3Only;
+    maintainers = [ lib.maintainers.vyp ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix b/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix
new file mode 100644
index 000000000000..9824a46d43ee
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix
@@ -0,0 +1,34 @@
+{ stdenv, lib, fetchFromGitLab, pkg-config, libyamlcpp, libevdev }:
+
+stdenv.mkDerivation rec {
+  pname = "dual-function-keys";
+  version = "1.4.0";
+
+  src = fetchFromGitLab {
+    group = "interception";
+    owner = "linux/plugins";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-xlplbkeptXMBlRnSsc5NgGJfT8aoZxTRgTwTOd7aiWg=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ libevdev libyamlcpp ];
+
+  prePatch = ''
+    substituteInPlace config.mk --replace \
+      '/usr/include/libevdev-1.0' \
+      "$(pkg-config --cflags libevdev | cut -c 3-)"
+  '';
+
+  installFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.com/interception/linux/plugins/dual-function-keys";
+    description = "Tap for one key, hold for another.";
+    license = licenses.mit;
+    maintainers = with maintainers; [ svend ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix b/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix
new file mode 100644
index 000000000000..8980abba2f62
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/keyfuzz/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  pname = "keyfuzz";
+  version = "0.2";
+
+  meta = with lib; {
+    description = "Manipulate the scancode/keycode translation tables of keyboard drivers";
+    homepage    = "http://0pointer.de/lennart/projects/keyfuzz/";
+    license     = licenses.gpl2Plus;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ mboes ];
+  };
+
+  src = fetchurl {
+    url = "http://0pointer.de/lennart/projects/keyfuzz/keyfuzz-0.2.tar.gz";
+    sha256 = "0xv9ymivp8fnyc5xcyh1vamxnx90bzw66wlld813fvm6q2gsiknk";
+  };
+
+  configureFlags = [ "--without-initdir" "--disable-lynx" ];
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/kime/default.nix b/nixpkgs/pkgs/tools/inputmethods/kime/default.nix
new file mode 100644
index 000000000000..68a91d2bfca7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/kime/default.nix
@@ -0,0 +1,113 @@
+{ lib, stdenv, rustPlatform, rustc, cargo, fetchFromGitHub, pkg-config, cmake, extra-cmake-modules, llvmPackages
+, withWayland ? true
+, withIndicator ? true, dbus, libdbusmenu
+, withXim ? true, xorg, cairo
+, withGtk2 ? true, gtk2
+, withGtk3 ? true, gtk3
+, withQt5 ? true, qt5
+}:
+
+let
+  cmake_args = lib.optionals withGtk2 ["-DENABLE_GTK2=ON"]
+  ++ lib.optionals withGtk3 ["-DENABLE_GTK3=ON"]
+  ++ lib.optionals withQt5 ["-DENABLE_QT5=ON"];
+
+  optFlag = w: (if w then "1" else "0");
+in
+stdenv.mkDerivation rec {
+  pname = "kime";
+  version = "2.5.6";
+
+  src = fetchFromGitHub {
+    owner = "Riey";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-r5luI6B4IjNTbh2tzpqabokgwkmbyXrA61+F2HDEWuo=";
+  };
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    sha256 = "sha256-GvBnNPY51RPt+I73oet5tB/EE2UsEPKbelJZkSY3xNw=";
+  };
+
+  # Replace autostart path
+  postPatch = ''
+    substituteInPlace res/kime.desktop --replace "/usr/bin/kime" "$out/bin/kime"
+  '';
+
+  dontUseCmakeConfigure = true;
+  dontWrapQtApps = true;
+  buildPhase = ''
+    runHook preBuild
+    export KIME_BUILD_CHECK=1
+    export KIME_BUILD_INDICATOR=${optFlag withIndicator}
+    export KIME_BUILD_XIM=${optFlag withXim}
+    export KIME_BUILD_WAYLAND=${optFlag withWayland}
+    export KIME_BUILD_KIME=1
+    export KIME_CARGO_ARGS="-j$NIX_BUILD_CORES --frozen"
+    export KIME_MAKE_ARGS="-j$NIX_BUILD_CORES"
+    export KIME_CMAKE_ARGS="${lib.concatStringsSep " " cmake_args}"
+    bash scripts/build.sh -r
+    runHook postBuild
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    cargo test --release --frozen
+    runHook postCheck
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    export KIME_BIN_DIR=bin
+    export KIME_INSTALL_HEADER=1
+    export KIME_INSTALL_DOC=1
+    export KIME_INCLUDE_DIR=include
+    export KIME_DOC_DIR=share/doc/kime
+    export KIME_ICON_DIR=share/icons
+    export KIME_LIB_DIR=lib
+    export KIME_QT5_DIR=lib/qt-${qt5.qtbase.version}
+    bash scripts/install.sh "$out"
+    runHook postInstall
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+    # Don't pipe output to head directly it will cause broken pipe error https://github.com/rust-lang/rust/issues/46016
+    kimeVersion=$(echo "$($out/bin/kime --version)" | head -n1)
+    echo "'kime --version | head -n1' returns: $kimeVersion"
+    [[ "$kimeVersion" == "kime ${version}" ]]
+    runHook postInstallCheck
+  '';
+
+  buildInputs = lib.optionals withIndicator [ dbus libdbusmenu ]
+  ++ lib.optionals withXim [ xorg.libxcb cairo ]
+  ++ lib.optionals withGtk2 [ gtk2 ]
+  ++ lib.optionals withGtk3 [ gtk3 ]
+  ++ lib.optionals withQt5 [ qt5.qtbase ];
+
+  nativeBuildInputs = [
+    pkg-config
+    llvmPackages.clang
+    llvmPackages.libclang
+    llvmPackages.bintools
+    cmake
+    extra-cmake-modules
+    rustPlatform.cargoSetupHook
+    rustc
+    cargo
+  ];
+
+  RUST_BACKTRACE = 1;
+  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+
+  meta = with lib; {
+    homepage = "https://github.com/Riey/kime";
+    description = "Korean IME";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.riey ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch
new file mode 100644
index 000000000000..4655879149d2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0001-hardcode-name.patch
@@ -0,0 +1,13 @@
+diff --git a/libinput-gestures b/libinput-gestures
+index 66479b6..aca94ac 100755
+--- a/libinput-gestures
++++ b/libinput-gestures
+@@ -6,7 +6,7 @@ from collections import OrderedDict
+ from pathlib import Path
+ from distutils.version import LooseVersion as Version
+ 
+-PROG = Path(sys.argv[0]).stem
++PROG = "libinput-gestures"
+ 
+ # Conf file containing gesture commands.
+ # Search first for user file then system file.
diff --git a/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch
new file mode 100644
index 000000000000..407450c8bccd
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/0002-paths.patch
@@ -0,0 +1,45 @@
+diff --git a/libinput-gestures b/libinput-gestures
+index aca94ac..c2f03ca 100755
+--- a/libinput-gestures
++++ b/libinput-gestures
+@@ -77,7 +77,7 @@ def get_libinput_vers():
+     'Return the libinput installed version number string'
+     # Try to use newer libinput interface then fall back to old
+     # (depreciated) interface.
+-    res = run(('libinput', '--version'), check=False)
++    res = run(('@libinput@', '--version'), check=False)
+     return res.strip() if res else \
+             run(('libinput-list-devices', '--version'), check=False)
+ 
+@@ -87,8 +87,8 @@ if not libvers:
+     sys.exit('libinput helper tools do not seem to be installed?')
+ 
+ if Version(libvers) >= Version('1.8'):
+-    cmd_debug_events = 'libinput debug-events'
+-    cmd_list_devices = 'libinput list-devices'
++    cmd_debug_events = '@libinput@ debug-events'
++    cmd_list_devices = '@libinput@ list-devices'
+ else:
+     cmd_debug_events = 'libinput-debug-events'
+     cmd_list_devices = 'libinput-list-devices'
+@@ -199,7 +199,7 @@ class COMMAND_internal(COMMAND):
+ 
+     def run(self):
+         'Get list of current workspaces and select next one'
+-        stdout = run(('wmctrl', '-d'), check=False)
++        stdout = run(('@wmctrl@', '-d'), check=False)
+         if not stdout:
+             # This command can fail on GNOME when you have only a single
+             # dynamic workspace using Xorg (probably a GNOME bug) so let's
+@@ -233,7 +233,7 @@ class COMMAND_internal(COMMAND):
+ 
+         # Switch to desired workspace
+         if index >= minindex and index < maxindex:
+-            run(('wmctrl', '-s', str(index)))
++            run(('@wmctrl@', '-s', str(index)))
+ 
+ # Table of gesture handlers
+ handlers = OrderedDict()
+-- 
+2.19.1
+
diff --git a/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix
new file mode 100644
index 000000000000..1d0ea40e34f4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/libinput-gestures/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper,
+  libinput, wmctrl, python3,
+  coreutils, xdotool ? null,
+  extraUtilsPath ? lib.optional (xdotool != null) xdotool
+}:
+stdenv.mkDerivation rec {
+  pname = "libinput-gestures";
+  version = "2.39";
+
+  src = fetchFromGitHub {
+    owner = "bulletmark";
+    repo = "libinput-gestures";
+    rev = version;
+    sha256 = "0bzyi55yhr9wyar9mnd09cr6pi88jkkp0f9lndm0a9jwi1xr4bdf";
+  };
+  patches = [
+    ./0001-hardcode-name.patch
+    ./0002-paths.patch
+  ];
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ python3 ];
+
+  postPatch =
+    ''
+      substituteInPlace libinput-gestures-setup --replace /usr/ /
+
+      substituteInPlace libinput-gestures \
+        --replace      /etc     "$out/etc" \
+        --subst-var-by libinput "${libinput}/bin/libinput" \
+        --subst-var-by wmctrl   "${wmctrl}/bin/wmctrl"
+    '';
+  installPhase =
+    ''
+      runHook preInstall
+      ${stdenv.shell} libinput-gestures-setup -d "$out" install
+      runHook postInstall
+    '';
+  postFixup =
+    ''
+      rm "$out/bin/libinput-gestures-setup"
+      substituteInPlace "$out/share/applications/libinput-gestures.desktop" --replace "/usr" "$out"
+      chmod +x "$out/share/applications/libinput-gestures.desktop"
+      wrapProgram "$out/bin/libinput-gestures" --prefix PATH : "${lib.makeBinPath ([coreutils] ++ extraUtilsPath)}"
+    '';
+
+  meta = with lib; {
+    homepage = "https://github.com/bulletmark/libinput-gestures";
+    description = "Gesture mapper for libinput";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ teozkr ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix b/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix
new file mode 100644
index 000000000000..0252efa3cdaa
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/libkkc/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl
+, vala, gobject-introspection, intltool, python2Packages, glib
+, pkg-config
+, libgee, json-glib, marisa, libkkc-data
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libkkc";
+  version = "0.3.5";
+
+  src = fetchurl {
+    url = "${meta.homepage}/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef";
+  };
+
+  nativeBuildInputs = [
+    vala gobject-introspection
+    python2Packages.python python2Packages.marisa
+    intltool glib pkg-config
+  ];
+
+  buildInputs = [ marisa libkkc-data ];
+  enableParallelBuilding = true;
+
+  propagatedBuildInputs = [ libgee json-glib ];
+
+  postInstall = ''
+    ln -s ${libkkc-data}/lib/libkkc/models $out/share/libkkc/models
+  '';
+
+  meta = with lib; {
+    description = "Japanese Kana Kanji conversion input method library";
+    homepage    = "https://github.com/ueno/libkkc";
+    license     = licenses.gpl3Plus;
+    maintainers = with maintainers; [ vanzef ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/lisgd/default.nix b/nixpkgs/pkgs/tools/inputmethods/lisgd/default.nix
new file mode 100644
index 000000000000..368f1efa7593
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/lisgd/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromSourcehut
+, writeText
+, libinput
+, libX11
+, wayland
+, conf ? null
+, patches ? [ ]
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lisgd";
+  version = "0.3.2";
+
+  src = fetchFromSourcehut {
+    owner = "~mil";
+    repo = "lisgd";
+    rev = version;
+    sha256 = "sha256-yE2CUv1XDvo8fW0bLS1O2oxgDUu4drCO3jFpxPgAYKU=";
+  };
+
+  inherit patches;
+
+  postPatch = let
+    configFile = if lib.isDerivation conf || lib.isPath conf then
+      conf
+    else
+      writeText "config.def.h" conf;
+  in lib.optionalString (conf != null) ''
+    cp ${configFile} config.def.h
+  '';
+
+  buildInputs = [
+    libinput
+    libX11
+    wayland
+  ];
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  meta = with lib; {
+    description = "Bind gestures via libinput touch events";
+    homepage = "https://git.sr.ht/~mil/lisgd";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix b/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix
new file mode 100644
index 000000000000..d24d1b44d862
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/m17n-db/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, gettext, gawk, bash }:
+
+stdenv.mkDerivation rec {
+  pname = "m17n-db";
+  version = "1.8.0";
+
+  src = fetchurl {
+    url = "https://download.savannah.gnu.org/releases/m17n/m17n-db-${version}.tar.gz";
+    sha256 = "0vfw7z9i2s9np6nmx1d4dlsywm044rkaqarn7akffmb6bf1j6zv5";
+  };
+
+  nativeBuildInputs = [ gettext ];
+  buildInputs = [ gettext gawk bash ];
+
+  strictDeps = true;
+
+  configureFlags = lib.optional (stdenv ? glibc)
+    "--with-charmaps=${stdenv.glibc.out}/share/i18n/charmaps"
+  ;
+
+  meta = {
+    homepage = "https://www.nongnu.org/m17n/";
+    description = "Multilingual text processing library (database)";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ astsmtl ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix
new file mode 100644
index 000000000000..cc290ab0eca9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, m17n_db, autoreconfHook, pkg-config }:
+stdenv.mkDerivation rec {
+  pname = "m17n-lib";
+  version = "1.8.0";
+
+  src = fetchurl {
+    url = "https://download.savannah.gnu.org/releases/m17n/m17n-lib-${version}.tar.gz";
+    sha256 = "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq";
+  };
+
+  strictDeps = true;
+
+  # reconf needed to sucesfully cross-compile
+  nativeBuildInputs = [
+    autoreconfHook pkg-config
+    # requires m17n-db tool at build time
+    m17n_db
+  ];
+
+  # Fails parallel build due to missing intra-package depends:
+  #   https://savannah.nongnu.org/bugs/index.php?61377
+  #     make[2]: *** No rule to make target '../src/libm17n-core.la', needed by 'libm17n.la'.  Stop.
+  enableParallelBuilding = false;
+
+  meta = {
+    homepage = "https://www.nongnu.org/m17n/";
+    description = "Multilingual text processing library (runtime)";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ astsmtl ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix
new file mode 100644
index 000000000000..b0d30a58d48e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/m17n-lib/otf.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, libXaw, freetype }:
+
+stdenv.mkDerivation rec {
+  pname = "libotf";
+  version = "0.9.16";
+
+  src = fetchurl {
+    url = "https://download.savannah.gnu.org/releases/m17n/${pname}-${version}.tar.gz";
+    sha256 = "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8";
+  };
+
+  patches = [
+    # https://salsa.debian.org/debian/libotf/-/tree/master/debian/patches
+    # Fix cross-compilation
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0002-use-pkg-config-not-freetype-config.patch";
+      sha256 = "sha256-VV9iGoNWIEie6UiLLTJBD+zxpvj0acgqkcBeAN1V6Kc=";
+    })
+    # these 2 are required by the above patch
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0001-do-not-add-flags-for-required-packages-to-pc-file.patch";
+      sha256 = "sha256-3kzqNPAHNVJQ1F4fyifq3AqLdChWli/k7wOq+ha+iDs=";
+    })
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0001-libotf-config-modify-to-support-multi-arch.patch";
+      sha256 = "sha256-SUlI87h+MtYWWtrAegzAnSds8JhxZwTJltDcj/se/Qc=";
+    })
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  buildInputs = [ libXaw freetype ];
+
+  outputs = [ "out" "dev" ];
+
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $out/bin/libotf-config $dev/bin/
+    substituteInPlace $dev/bin/libotf-config \
+      --replace "pkg-config" "${pkg-config}/bin/pkg-config"
+  '';
+
+  meta = {
+    homepage = "https://www.nongnu.org/m17n/";
+    description = "Multilingual text processing library (libotf)";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ bendlas ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix b/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix
new file mode 100644
index 000000000000..72f13d4eb2dc
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/nabi/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, libhangul }:
+
+stdenv.mkDerivation rec {
+  pname = "nabi";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/nabi/nabi-${version}.tar.gz";
+    sha256 = "0craa24pw7b70sh253arv9bg9sy4q3mhsjwfss3bnv5nf0xwnncw";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 libhangul ];
+
+  meta = with lib; {
+    description = "The Easy Hangul XIM";
+    homepage = "https://github.com/choehwanjin/nabi";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.ianwookim ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/netevent/default.nix b/nixpkgs/pkgs/tools/inputmethods/netevent/default.nix
new file mode 100644
index 000000000000..b7c0e4d47020
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/netevent/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, docutils, installShellFiles }:
+
+stdenv.mkDerivation {
+  pname = "netevent";
+  version = "20201018";
+
+  src = fetchFromGitHub {
+    owner = "Blub";
+    repo = "netevent";
+    rev = "ddd330f0dc956a95a111c58ad10546071058e4c1";
+    sha256 = "0myk91pmim0m51h4b8hplkbxvns0icvfmv0401r0hw8md828nh5c";
+  };
+
+  buildInputs = [ docutils ];
+  nativeBuildInputs = [ installShellFiles ];
+
+  outputs = [ "out" "doc" "man" ];
+
+  configurePhase = ''
+    export RST2MAN=rst2man
+    ./configure
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install -m 0755 netevent $out/bin/
+
+    installManPage doc/netevent.1
+
+    mkdir -p $doc/share/doc/netevent
+    cp doc/netevent.rst $doc/share/doc/netevent/netevent.rst
+  '';
+
+  meta = with lib; {
+    description = "Share linux event devices with other machines";
+    homepage = "https://github.com/Blub/netevent";
+    license = licenses.gpl2Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ rgrunbla ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/remote-touchpad/default.nix b/nixpkgs/pkgs/tools/inputmethods/remote-touchpad/default.nix
new file mode 100644
index 000000000000..0028fa6b7b23
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/remote-touchpad/default.nix
@@ -0,0 +1,33 @@
+{ buildGoModule
+, fetchFromGitHub
+, lib
+, libX11
+, libXi
+, libXt
+, libXtst
+}:
+
+buildGoModule rec {
+  pname = "remote-touchpad";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "unrud";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-XyE8N+YVwfgxToKkhpe8zJ0e3HFDpKt7cfERxWCfbfU=";
+  };
+
+  buildInputs = [ libX11 libXi libXt libXtst ];
+  tags = [ "portal,x11" ];
+
+  vendorSha256 = "sha256-zTx38kW/ylXXML73C2sFQciV2y3+qbO0S/ZdkiEh5Qs=";
+
+  meta = with lib; {
+    description = "Control mouse and keyboard from the webbrowser of a smartphone.";
+    homepage = "https://github.com/unrud/remote-touchpad";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ schnusch ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix
new file mode 100644
index 000000000000..f20e2899f185
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/skk/skk-dicts/default.nix
@@ -0,0 +1,80 @@
+{ lib, stdenv, fetchurl, buildPackages, libiconv, skktools }:
+
+let
+  # kana to kanji
+  small = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.S";
+    sha256 = "11cjrc8m99hj4xpl2nvzxanlswpapi92vmgk9d6yimdz0jidb6cq";
+  };
+  medium = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.M";
+    sha256 = "0pwjp9qjmn9sq6zc0k6632l7dc2dbjn45585ibckvvl9iwfqqxdp";
+  };
+  large = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.L";
+    sha256 = "0ps0a7sbkryd6hxvphq14i7g5wci4gvr0vraac8ia2ww67a2xbyc";
+  };
+
+  # english to japanese
+  edict = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.edict";
+    sha256 = "1vrwnq0vvjn61nijbln6wfinqg93802d2a8d4ad82n692v83b1li";
+  };
+  # misc
+  assoc = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.assoc";
+    sha256 = "1smcbyv6srrhnpl7ic9nqds9nz3g2dgqngmhzkrdlwmvcpvakp1v";
+  };
+
+  iconvBin = if stdenv.isDarwin then libiconv else  buildPackages.stdenv.cc.libc;
+in
+
+stdenv.mkDerivation {
+  pname = "skk-dicts-unstable";
+  version = "2020-03-24";
+  srcs = [ small medium large edict assoc ];
+  nativeBuildInputs = [ skktools ] ++ lib.optional stdenv.isDarwin libiconv;
+
+  strictDeps = true;
+
+  dontUnpack = true;
+
+  installPhase = ''
+    function dictname() {
+      src=$1
+      name=$(basename $src)          # remove dir name
+      dict=$(echo $name | cut -b34-) # remove sha256 prefix
+      echo $dict
+    }
+    mkdir -p $out/share
+
+    for src in $srcs; do
+      dst=$out/share/$(dictname $src)
+      echo ";;; -*- coding: utf-8 -*-" > $dst  # libskk requires this on the first line
+      ${lib.getBin iconvBin}/bin/iconv \
+        -f EUC-JP -t UTF-8 $src | skkdic-expr2 >> $dst
+    done
+
+    # combine .L .edict and .assoc for convenience
+    dst=$out/share/SKK-JISYO.combined
+    echo ";;; -*- coding: utf-8 -*-" > $dst
+    skkdic-expr2 \
+      $out/share/$(dictname ${large}) + \
+      $out/share/$(dictname ${edict}) + \
+      $out/share/$(dictname ${assoc}) >> $dst
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A collection of standard SKK dictionaries";
+    longDescription = ''
+      This package provides a collection of standard kana-to-kanji
+      dictionaries for the SKK Japanese input method.
+    '';
+    homepage = "https://github.com/skk-dev/dict";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ yuriaisaka ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix b/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix
new file mode 100644
index 000000000000..130c27090a48
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, gdbm, glib }:
+
+# Note (2017-10-24, yuriaisaka):
+# - Version 1.3.3 dates from Jul. 19, 2013.
+# - The latest commit to the github repo dates from Mar. 05, 2017
+# - The repo since appears to have become a kitchen sink place to keep
+#   misc tools to handle SKK dictionaries, and these tools have runtime
+#   dependencies on a Ruby interpreter etc.
+# - We for the moment do not package them to keep the dependencies slim.
+#   Probably, shall package the newer tools as skktools-extra in the future.
+stdenv.mkDerivation rec {
+  pname = "skktools";
+  version = "1.3.4";
+  src = fetchFromGitHub {
+    owner = "skk-dev";
+    repo = "skktools";
+    rev = "skktools-${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "1zway8jsm18279xq8zlpr84iqiw373x3v0ysay74n9bjqxbl234a";
+  };
+  # # See "12.2. Package naming"
+  # name = "skktools-unstable-${version}";
+  # version = "2017-03-05";
+  # src = fetchFromGitHub {
+  #   owner = "skk-dev";
+  #   repo = "skktools";
+  #   rev = "e14d98e734d2fdff611385c7df65826e94d929db";
+  #   sha256 = "1k9zxqybl1l5h0a8px2awc920qrdyp1qls50h3kfrj3g65d08aq2";
+  # };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gdbm glib ];
+
+  meta = {
+    description = "A collection of tools to edit SKK dictionaries";
+    longDescription = ''
+      This package provides a collection of tools to manipulate
+      (merge, sort etc.) the dictionaries formatted for SKK Japanese
+      input method.
+    '';
+    homepage = "https://github.com/skk-dev/skktools";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ yuriaisaka ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix b/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix
new file mode 100644
index 000000000000..627445136410
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation {
+  pname = "tegaki-zinnia-japanese";
+  version = "0.3";
+
+  src = fetchurl {
+    url = "http://www.tegaki.org/releases/0.3/models/tegaki-zinnia-japanese-0.3.zip";
+    sha256 = "1nmg9acxhcqly9gwkyb9m0hpy76fll91ywk4b1q4xms0ajxip1h7";
+  };
+
+  meta = with lib; {
+    description = "Japanese handwriting model for the Zinnia engine";
+    homepage = "http://tegaki.org/";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.gebner ];
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  makeFlags = [ "installpath=$(out)/share/tegaki/models/zinnia/" ];
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix b/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix
new file mode 100644
index 000000000000..c78890772717
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/touchegg/default.nix
@@ -0,0 +1,76 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, nix-update-script
+, systemd
+, libinput
+, pugixml
+, cairo
+, xorg
+, gtk3-x11
+, pcre
+, pkg-config
+, cmake
+, pantheon
+, withPantheon ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "touchegg";
+  version = "2.0.13";
+
+  src = fetchFromGitHub {
+    owner = "JoseExposito";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-wfXA4+HSLFHMvdsnyiTfRxPqdSsvd0RMkKIacf+rLZI=";
+  };
+
+  patches = lib.optionals withPantheon [
+    # Disable per-application gesture by default to make sure the default
+    # config does not conflict with Pantheon switchboard settings.
+    (fetchpatch {
+      url = "https://github.com/elementary/os-patches/commit/7d9b133e02132d7f13cf2fe850b2fe4c015c3c5e.patch";
+      sha256 = "sha256-ZOGVkxiXoTORXC6doz5r9IObAbYjhsDjgg3HtzlTSUc=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+  ];
+
+  buildInputs = [
+    systemd
+    libinput
+    pugixml
+    cairo
+    gtk3-x11
+    pcre
+  ] ++ (with xorg; [
+    libX11
+    libXtst
+    libXrandr
+    libXi
+    libXdmcp
+    libpthreadstubs
+    libxcb
+  ]);
+
+  PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/JoseExposito/touchegg";
+    description = "Linux multi-touch gesture recognizer";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = teams.pantheon.members;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix b/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix
new file mode 100644
index 000000000000..e7ef0f8accf1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/triggerhappy/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, perl, systemd }:
+
+stdenv.mkDerivation rec {
+  pname = "triggerhappy";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "wertarbyte";
+    repo = "triggerhappy";
+    rev = "release/${version}";
+    sha256 = "0gb1qhrxwq7i5abd408d01a2dpf28nr1fph1fg7w7n0i5i1nnk90";
+  };
+
+  nativeBuildInputs = [ pkg-config perl ];
+  buildInputs = [ systemd ];
+
+  makeFlags = [ "PREFIX=$(out)" "BINDIR=$(out)/bin" ];
+
+  postInstall = ''
+    install -D -m 644 -t "$out/etc/triggerhappy/triggers.d" "triggerhappy.conf.examples"
+  '';
+
+  meta = with lib; {
+    description = "A lightweight hotkey daemon";
+    longDescription = ''
+      Triggerhappy is a hotkey daemon developed with small and embedded systems in
+      mind, e.g. linux based routers. It attaches to the input device files and
+      interprets the event data received and executes scripts configured in its
+      configuration.
+    '';
+    homepage = "https://github.com/wertarbyte/triggerhappy/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jfrankenau taha ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch b/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch
new file mode 100644
index 000000000000..be80962527ba
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/uim/data-hook.patch
@@ -0,0 +1,38 @@
+--- a/gtk2/immodule/Makefile.in	2015-11-24 16:21:08.967087208 +0900
++++ b/gtk2/immodule/Makefile.in	2015-11-24 16:22:53.316095150 +0900
+@@ -928,7 +928,6 @@
+ 
+ install-data-am: install-moduleLTLIBRARIES
+ 	@$(NORMAL_INSTALL)
+-	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+ install-dvi: install-dvi-am
+ 
+ install-dvi-am:
+@@ -993,7 +992,7 @@
+ 	distclean-compile distclean-generic distclean-libtool \
+ 	distclean-tags distdir dvi dvi-am html html-am info info-am \
+ 	install install-am install-data install-data-am \
+-	install-data-hook install-dvi install-dvi-am install-exec \
++	install-dvi install-dvi-am install-exec \
+ 	install-exec-am install-html install-html-am install-info \
+ 	install-info-am install-man install-moduleLTLIBRARIES \
+ 	install-pdf install-pdf-am install-ps install-ps-am \
+--- a/gtk3/immodule/Makefile.in	2015-11-24 16:21:08.971087209 +0900
++++ b/gtk3/immodule/Makefile.in	2015-11-24 16:23:28.251097832 +0900
+@@ -896,7 +896,6 @@
+ 
+ install-data-am: install-moduleLTLIBRARIES
+ 	@$(NORMAL_INSTALL)
+-	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+ install-dvi: install-dvi-am
+ 
+ install-dvi-am:
+@@ -959,7 +958,7 @@
+ 	cscopelist-am ctags ctags-am distclean distclean-compile \
+ 	distclean-generic distclean-libtool distclean-tags distdir dvi \
+ 	dvi-am html html-am info info-am install install-am \
+-	install-data install-data-am install-data-hook install-dvi \
++	install-data install-data-am install-dvi \
+ 	install-dvi-am install-exec install-exec-am install-html \
+ 	install-html-am install-info install-info-am install-man \
+ 	install-moduleLTLIBRARIES install-pdf install-pdf-am \
diff --git a/nixpkgs/pkgs/tools/inputmethods/uim/default.nix b/nixpkgs/pkgs/tools/inputmethods/uim/default.nix
new file mode 100644
index 000000000000..9336d5429c12
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/uim/default.nix
@@ -0,0 +1,146 @@
+{ lib, stdenv, fetchFromGitHub, shared-mime-info
+, autoconf, automake, intltool, libtool, pkg-config, cmake
+, ruby, librsvg
+, ncurses, m17n_lib, m17n_db, expat
+, withAnthy ? true, anthy ? null
+, withGtk ? true
+, withGtk2 ? withGtk, gtk2 ? null
+, withGtk3 ? withGtk, gtk3 ? null
+, withQt ? true
+, withQt4 ? withQt, qt4 ? null
+, withQt5 ? false, qt5 ? null
+, withLibnotify ? true, libnotify ? null
+, withSqlite ? true, sqlite ? null
+, withNetworking ? true, curl ? null, openssl ? null
+, withFFI ? true, libffi ? null
+
+# Things that are clearly an overkill to be enabled by default
+, withMisc ? false, libeb ? null
+}:
+
+with lib;
+
+assert withGtk2 -> gtk2 != null;
+assert withGtk3 -> gtk3 != null;
+
+# TODO(@oxij): ./configure can't find both qmakes at the same time
+# this can be fixed by adding an alias qmake -> qmaka${version} in qmake derivation
+assert withQt4 -> !withQt5 && qt4 != null;
+assert withQt5 -> !withQt4 && qt5 != null;
+
+assert !withQt5; # fails to build with "Makefile.qmake: No such file or directory"
+
+assert withAnthy -> anthy != null;
+assert withLibnotify -> libnotify != null;
+assert withSqlite -> sqlite != null;
+assert withNetworking -> curl != null && openssl != null;
+assert withFFI -> libffi != null;
+assert withMisc -> libeb != null;
+
+stdenv.mkDerivation rec {
+  version = "1.8.8";
+  pname = "uim";
+
+  src = fetchFromGitHub {
+    owner = "uim";
+    repo = "uim";
+    rev = "2c0958c9c505a87e70e344c2192e2e5123c71ea5";
+    fetchSubmodules = true;
+    sha256 = "1hkjxi5r49gcna37m3jvykny5hz9ram4y8a3q7lw4qzr52mz9pdp";
+  };
+
+  nativeBuildInputs = [
+    autoconf automake intltool libtool pkg-config cmake
+
+    ruby # used by sigscheme build to generate function tables
+    librsvg # used by uim build to generate png pixmaps from svg
+  ];
+
+  buildInputs = [
+    ncurses m17n_lib m17n_db expat
+  ]
+  ++ optional withAnthy anthy
+  ++ optional withGtk2 gtk2
+  ++ optional withGtk3 gtk3
+  ++ optional withQt4 qt4
+  ++ optionals withQt5 [ qt5.qtbase.bin qt5.qtbase.dev ]
+  ++ optional withLibnotify libnotify
+  ++ optional withSqlite sqlite
+  ++ optionals withNetworking [
+    curl openssl
+  ]
+  ++ optional withFFI libffi
+  ++ optional withMisc libeb;
+
+  prePatch = ''
+    patchShebangs *.sh */*.sh */*/*.sh
+
+    # configure sigscheme in maintainer mode or else some function tables won't get autogenerated
+    substituteInPlace configure.ac \
+      --replace "--with-master-pkg=uim --enable-conf=uim" \
+                "--enable-maintainer-mode --with-master-pkg=uim --enable-conf=uim"
+
+    # generate ./configure files
+    (cd sigscheme/libgcroots; ./autogen.sh)
+    (cd sigscheme; ./autogen.sh)
+    ./autogen.sh
+  '';
+
+  patches = [ ./data-hook.patch ];
+
+  configureFlags = [
+    # configure in maintainer mode or else some pixmaps won't get autogenerated
+    # this should imply the above `--enable-maintainer-mode`, but it does not
+    "--enable-maintainer-mode"
+
+    "--enable-pref"
+    "--with-skk"
+    "--with-x"
+    "--with-xft"
+    "--with-expat=${expat.dev}"
+  ]
+  ++ optional withAnthy "--with-anthy-utf8"
+  ++ optional withGtk2 "--with-gtk2"
+  ++ optional withGtk3 "--with-gtk3"
+  ++ optionals withQt4 [
+    "--with-qt4"
+    "--with-qt4-immodule"
+  ]
+  ++ optionals withQt5 [
+    "--with-qt5"
+    "--with-qt5-immodule"
+  ]
+  ++ optional withLibnotify "--enable-notify=libnotify"
+  ++ optional withSqlite "--with-sqlite3"
+  ++ optionals withNetworking [
+    "--with-curl"
+    "--with-openssl-dir=${openssl.dev}"
+  ]
+  ++ optional withFFI "--with-ffi"
+  ++ optional withMisc "--with-eb";
+
+  # TODO: things in `./configure --help`, but not in nixpkgs
+  #--with-canna            Use Canna [default=no]
+  #--with-wnn              Build with libwnn [default=no]
+  #--with-mana             Build a plugin for Mana [default=yes]
+  #--with-prime            Build a plugin for PRIME [default=yes]
+  #--with-sj3              Use SJ3 [default=no]
+  #--with-osx-dcs          Build with OS X Dictionary Services [default=no]
+
+  # TODO: fix this in librsvg/glib later
+  # https://github.com/NixOS/nixpkgs/pull/57027#issuecomment-475461733
+  preBuild = ''
+    export XDG_DATA_DIRS="${shared-mime-info}/share"
+  '';
+
+  dontUseCmakeConfigure = true;
+
+  meta = with lib; {
+    homepage    = src.meta.homepage;
+    description = "A multilingual input method framework";
+    license     = licenses.bsd3;
+    platforms   = platforms.unix;
+    broken      = stdenv.hostPlatform.isAarch64; # fails to build libgcroots (not supported on aarch64)
+    maintainers = with maintainers; [ ericsagnes oxij ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix b/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix
new file mode 100644
index 000000000000..8070dbc66ba8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/inputmethods/zinnia/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "zinnia";
+  version = "2016-08-28";
+
+  src = fetchFromGitHub {
+    owner = "taku910";
+    repo = "zinnia";
+    rev = "fd74d8c8680bb3df8692279151ea6339ab68e32b";
+    sha256 = "1izjy5qw6swg0rs2ym2i72zndb90mwrfbd1iv8xbpwckbm4899lg";
+  };
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */zinnia)
+  '';
+
+  meta = with lib; {
+    description = "Online hand recognition system with machine learning";
+    homepage = "http://taku910.github.io/zinnia/";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.gebner ];
+  };
+}