inputMethod service: init

This commit is contained in:
Eric Sagnes 2016-02-16 23:10:46 +09:00
parent 3ed3f061da
commit 3ad12f2dec
7 changed files with 34 additions and 52 deletions

View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
with lib;
{
options = {
i18n.inputMethod = {
enabled = mkOption {
type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" ]);
default = null;
example = "fcitx";
description = ''
Select the enabled input method. Input methods is a software to input symbols that are not available on standard input devices.
Input methods are specially used to input Chinese, Japanese and Korean characters.
Currently the following input methods are available in NixOS:
<itemizedlist>
<listitem><para>ibus: The intelligent input bus, extra input engines can be added using <literal>i18n.inputMethod.ibus.engines</literal>.</para></listitem>
<listitem><para>fcitx: A customizable lightweight input method, extra input engines can be added using <literal>i18n.inputMethod.fcitx.engines</literal>.</para></listitem>
<listitem><para>nabi: A Korean input method based on XIM. Nabi doesn't support Qt 5.</para></listitem>
<listitem><para>uim: The universal input method, is a library with a XIM bridge. uim mainly support Chinese, Japanese and Korean.</para></listitem>
</itemizedlist>
'';
};
};
};
}

View file

@ -14,15 +14,6 @@ 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 = [];
@ -36,7 +27,7 @@ in
};
config = mkIf cfg.enable {
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
environment.systemPackages = [ fcitxPackage ];
gtkPlugins = [ fcitxPackage ];
qtPlugins = [ fcitxPackage ];

View file

@ -13,15 +13,6 @@ in
{
options = {
i18n.inputMethod.ibus = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable IBus input method.
IBus can be used input of Chinese, Korean, Japanese and other special characters.
'';
};
engines = mkOption {
type = with types; listOf ibusEngine;
default = [];
@ -34,7 +25,7 @@ in
};
};
config = mkIf cfg.enable {
config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
# Without dconf enabled it is impossible to use IBus
environment.systemPackages = [ ibusPackage pkgs.gnome3.dconf ];

View file

@ -1,28 +1,8 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.nabi;
in
{
options = {
i18n.inputMethod.nabi = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable nabi input method.
Nabi can be used to input Korean.
'';
};
};
};
{
config = mkIf cfg.enable {
config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
environment.systemPackages = [ pkgs.nabi ];
qtPlugins = [ pkgs.nabi ];

View file

@ -9,15 +9,6 @@ in
options = {
i18n.inputMethod.uim = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Enable uim input method.
Uim can be used to input of Chinese, Korean, Japanese and other special characters.
'';
};
toolbar = mkOption {
type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ];
default = "gtk";
@ -30,7 +21,7 @@ in
};
config = mkIf cfg.enable {
config = mkIf (config.i18n.inputMethod.enabled == "uim") {
environment.systemPackages = [ pkgs.uim ];
gtkPlugins = [ pkgs.uim ];
qtPlugins = [ pkgs.uim ];

View file

@ -43,6 +43,7 @@
./hardware/video/nvidia.nix
./hardware/video/ati.nix
./hardware/video/webcam/facetimehd.nix
./i18n/inputMethod/default.nix
./i18n/inputMethod/fcitx.nix
./i18n/inputMethod/ibus.nix
./i18n/inputMethod/nabi.nix

View file

@ -60,7 +60,6 @@ with lib;
(mkRenamedOptionModule [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ])
# ibus
(mkRenamedOptionModule [ "programs" "ibus" "enable" ] [ "i18n" "inputMethod" "ibus" "enable" ])
(mkRenamedOptionModule [ "programs" "ibus" "plugins" ] [ "i18n" "inputMethod" "ibus" "engines" ])
# proxy