3
0
Fork 0
forked from mirrors/nixpkgs

fcitx service: init

This commit is contained in:
Eric Sagnes 2015-11-25 16:29:50 +09:00
parent a0457135d8
commit 850be632a0
8 changed files with 96 additions and 35 deletions

View file

@ -0,0 +1,51 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.fcitx;
fcitxPackage = pkgs.fcitx-with-plugins.override { plugins = cfg.engines; };
fcitxEngine = types.package // {
name = "fcitx-engine";
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isFcitxEngine"] false x);
};
in
{
options = {
i18n.inputMethod.fcitx = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable Fcitx input method.
Fcitx can be used to input of Chinese, Korean, Japanese and other special characters.
'';
};
engines = mkOption {
type = with types; listOf fcitxEngine;
default = [];
example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
description = ''
Enabled Fcitx engines.
Available engines can be found by running `nix-env "<nixpkgs>" . -qaP -A fcitx-engines`.
'';
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ fcitxPackage ];
gtkPlugins = [ fcitxPackage ];
qtPlugins = [ fcitxPackage pkgs.kde5.fcitx-qt5 ];
environment.variables = {
GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
};
services.xserver.displayManager.sessionCommands = "${fcitxPackage}/bin/fcitx";
};
}

View file

@ -43,6 +43,7 @@
./hardware/video/nvidia.nix
./hardware/video/ati.nix
./hardware/video/webcam/facetimehd.nix
./i18n/inputMethod/fcitx.nix
./installer/tools/auto-upgrade.nix
./installer/tools/nixos-checkout.nix
./installer/tools/tools.nix

View file

@ -17,10 +17,11 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
description = "Fcitx Wrapper for anthy";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ iyzsong ericsagnes ];
isFcitxEngine = true;
description = "Fcitx Wrapper for anthy";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ iyzsong ericsagnes ];
};
}

View file

@ -19,12 +19,13 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
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 ];
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 ];
};
}

View file

@ -19,11 +19,12 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
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 ];
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 ];
};
}

View file

@ -105,12 +105,13 @@ in clangStdenv.mkDerivation rec {
'';
meta = with clangStdenv.lib; {
description = "Fcitx engine for Google japanese input method";
homepage = http://code.google.com/p/mozc/;
downloadPage = "http://download.fcitx-im.org/fcitx-mozc/";
license = licenses.free;
platforms = platforms.linux;
maintainers = [ maintainers.ericsagnes ];
isFcitxEngine = true;
description = "Fcitx engine for Google japanese input method";
homepage = http://code.google.com/p/mozc/;
downloadPage = "http://download.fcitx-im.org/fcitx-mozc/";
license = licenses.free;
platforms = platforms.linux;
maintainers = [ maintainers.ericsagnes ];
};
}

View file

@ -17,12 +17,13 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
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 ];
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 ];
};
}

View file

@ -1511,18 +1511,22 @@ let
fcitx = callPackage ../tools/inputmethods/fcitx { };
fcitx-anthy = callPackage ../tools/inputmethods/fcitx-engines/fcitx-anthy { };
fcitx-engines = {
fcitx-chewing = callPackage ../tools/inputmethods/fcitx-engines/fcitx-chewing { };
anthy = callPackage ../tools/inputmethods/fcitx-engines/fcitx-anthy { };
fcitx-hangul = callPackage ../tools/inputmethods/fcitx-engines/fcitx-hangul { };
chewing = callPackage ../tools/inputmethods/fcitx-engines/fcitx-chewing { };
hangul = callPackage ../tools/inputmethods/fcitx-engines/fcitx-hangul { };
mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc {
inherit (pythonPackages) gyp;
};
table-other = callPackage ../tools/inputmethods/fcitx-engines/fcitx-table-other { };
fcitx-mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc {
inherit (pythonPackages) gyp;
};
fcitx-table-other = callPackage ../tools/inputmethods/fcitx-engines/fcitx-table-other { };
fcitx-configtool = callPackage ../tools/inputmethods/fcitx/fcitx-configtool.nix { };
fcitx-with-plugins = callPackage ../tools/inputmethods/fcitx/wrapper.nix {