diff options
-rw-r--r-- | nixos/modules/i18n/inputMethod/default.nix | 29 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/fcitx.nix | 11 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/ibus.nix | 11 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/nabi.nix | 22 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/uim.nix | 11 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/rename.nix | 1 |
7 files changed, 34 insertions, 52 deletions
diff --git a/nixos/modules/i18n/inputMethod/default.nix b/nixos/modules/i18n/inputMethod/default.nix new file mode 100644 index 0000000000000..7e6a25bfb0847 --- /dev/null +++ b/nixos/modules/i18n/inputMethod/default.nix @@ -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> + ''; + }; + }; + }; +} diff --git a/nixos/modules/i18n/inputMethod/fcitx.nix b/nixos/modules/i18n/inputMethod/fcitx.nix index b0e7578810adc..f168f4451703f 100644 --- a/nixos/modules/i18n/inputMethod/fcitx.nix +++ b/nixos/modules/i18n/inputMethod/fcitx.nix @@ -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 ]; diff --git a/nixos/modules/i18n/inputMethod/ibus.nix b/nixos/modules/i18n/inputMethod/ibus.nix index e4bc15cf8912a..86059751a3d20 100644 --- a/nixos/modules/i18n/inputMethod/ibus.nix +++ b/nixos/modules/i18n/inputMethod/ibus.nix @@ -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 ]; diff --git a/nixos/modules/i18n/inputMethod/nabi.nix b/nixos/modules/i18n/inputMethod/nabi.nix index 7f97135fee1e8..8c39659551309 100644 --- a/nixos/modules/i18n/inputMethod/nabi.nix +++ b/nixos/modules/i18n/inputMethod/nabi.nix @@ -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 ]; diff --git a/nixos/modules/i18n/inputMethod/uim.nix b/nixos/modules/i18n/inputMethod/uim.nix index 0154cdc5057a4..401e1932f70c4 100644 --- a/nixos/modules/i18n/inputMethod/uim.nix +++ b/nixos/modules/i18n/inputMethod/uim.nix @@ -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 ]; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7fe4a90a1354e..eb4045fdfdc30 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -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 diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 698c28f37c8ea..6d5ee6fc84e98 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -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 |