diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-table/wrapper.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-table/wrapper.nix new file mode 100644 index 0000000000000..0effd99974646 --- /dev/null +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-table/wrapper.nix @@ -0,0 +1,33 @@ +{ stdenv, buildEnv, ibus-table }: + +# Intended usage: +# Add something like the following in /etc/nixos/configuration.nix: +# i18n.inputMethod = { +# enabled = "ibus"; +# ibus.engines = with pkgs.ibus-engines; [ +# (table-with-plugins [ table-others ]) +# ]; +# }; + +plugins: + +stdenv.lib.overrideDerivation ibus-table (self: { + name = "ibus-table-with-plugins-" + self.version; + + paths = plugins; + + postInstall = '' + for plugin in $paths + do + for t in $plugin/share/ibus-table/tables/* + do + ln -s "$t" "$out/share/ibus-table/tables" + done + + for i in $plugin/share/ibus-table/icons/* + do + ln -s "$i" "$out/share/ibus-table/icons" + done + done + ''; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b54fb2f892d0b..9f86e0a21873c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1078,6 +1078,10 @@ in inherit (gnome3) dconf; }; + table-with-plugins = callPackage ../tools/inputmethods/ibus-engines/ibus-table/wrapper.nix { + ibus-table = ibus-engines.table; + }; + table-others = callPackage ../tools/inputmethods/ibus-engines/ibus-table-others { ibus-table = ibus-engines.table; };