Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/tools/inputmethods/fcitx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
}:

stdenv.mkDerivation rec {
name = "fcitx-4.2.8.5";
name = "fcitx-${version}";
version = "4.2.8.5";

src = fetchurl {
url = "http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz";
Expand Down
35 changes: 35 additions & 0 deletions pkgs/tools/inputmethods/fcitx/wrapper.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ stdenv, buildEnv, fcitx, makeWrapper, plugins }:

# This is based on the pidgin-with-plugins package.
# Users should be able to configure what plugins are used
# by putting the following in their /etc/nixos/configuration.nix:
# environment.systemPackages = with pkgs; [
# (fcitx-with-plugins.override { plugins = [ fcitx-anthy ]; })
# ]
# Or, a normal user could use it by putting the following in his
# ~/.nixpkgs/config.nix:
# packageOverrides = pkgs: with pkgs; rec {
# (fcitx-with-plugins.override { plugins = [ fcitx-anthy ]; })
# }

let
drv = buildEnv {
name = "fcitx-with-plugins-" + (builtins.parseDrvName fcitx.name).version;

paths = [ fcitx ] ++ plugins;

postBuild = ''
# TODO: This could be avoided if buildEnv could be forced to create all directories
if [ -L $out/bin ]; then
rm $out/bin
mkdir $out/bin
for i in ${fcitx}/bin/*; do
ln -s $i $out/bin
done
fi
wrapProgram $out/bin/fcitx \
--set FCITXDIR "$out/"
'';
};
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })

4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,10 @@ let

fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };

fcitx-with-plugins = callPackage ../tools/inputmethods/fcitx/wrapper.nix {
plugins = [ ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about including a set of plugins that make sense for most people? Or is that indeed the null set? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wmertens, I believe it is the null set.

Most of fcitx's plugins enable communication with additional IME libraries. The only plugin currently available is anthy, which enables Japanese input.

There are a couple other commonly used Japanese input plugins, but there are not packages for them yet in Nix. In most cases, it wouldn't really make sense to use them together.

I believe there are also other commonly used plugins for Korean and Chinese, but it also wouldn't make sense to use these plugins together (unless you speak Korean, Chinese, Japanese, etc).

};

fcron = callPackage ../tools/system/fcron { };

fdm = callPackage ../tools/networking/fdm {};
Expand Down