2016-02-10 05:00:58 +00:00
|
|
|
{ stdenv, buildEnv, fcitx, fcitx-configtool, makeWrapper, plugins, kde5 }:
|
2014-11-05 01:23:39 +00:00
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
2016-02-10 05:00:58 +00:00
|
|
|
paths = [ fcitx fcitx-configtool kde5.fcitx-qt5 ] ++ plugins;
|
2014-11-05 01:23:39 +00:00
|
|
|
|
|
|
|
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 ]; })
|
|
|
|
|