diff options
author | Antonio Yang <yanganto@gmail.com> | 2020-09-17 00:01:57 +0800 |
---|---|---|
committer | Antonio Yang <yanganto@gmail.com> | 2020-10-03 22:27:22 +0800 |
commit | 0c138794af79ddc3907b6e3375edde5aaec08001 (patch) | |
tree | ee11a07bdb58a2124cbdfe1a70b4406e2d547ebf /nixos/modules/i18n/input-method | |
parent | 9d71f4f2e20eb6b0f51e99212e66d42c0b89cf2d (diff) |
input methods: add hime
Diffstat (limited to 'nixos/modules/i18n/input-method')
-rw-r--r-- | nixos/modules/i18n/input-method/default.nix | 3 | ||||
-rw-r--r-- | nixos/modules/i18n/input-method/default.xml | 25 | ||||
-rw-r--r-- | nixos/modules/i18n/input-method/hime.nix | 28 |
3 files changed, 55 insertions, 1 deletions
diff --git a/nixos/modules/i18n/input-method/default.nix b/nixos/modules/i18n/input-method/default.nix index 9548a249efa0..0d6dd3399bfc 100644 --- a/nixos/modules/i18n/input-method/default.nix +++ b/nixos/modules/i18n/input-method/default.nix @@ -29,7 +29,7 @@ in options.i18n = { inputMethod = { enabled = mkOption { - type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" ]); + type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" "hime" ]); default = null; example = "fcitx"; description = '' @@ -44,6 +44,7 @@ in <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> + <listitem><para>hime: An extremely easy-to-use input method framework.</para></listitem> </itemizedlist> ''; }; diff --git a/nixos/modules/i18n/input-method/default.xml b/nixos/modules/i18n/input-method/default.xml index 117482fb0d57..e15f66690819 100644 --- a/nixos/modules/i18n/input-method/default.xml +++ b/nixos/modules/i18n/input-method/default.xml @@ -35,6 +35,11 @@ Uim: The universal input method, is a library with a XIM bridge. </para> </listitem> + <listitem> + <para> + Hime: An extremely easy-to-use input method framework. + </para> + </listitem> </itemizedlist> <section xml:id="module-services-input-methods-ibus"> <title>IBus</title> @@ -241,4 +246,24 @@ i18n.inputMethod = { used to choose uim toolbar. </para> </section> + <section xml:id="module-services-input-methods-hime"> + <title>Hime</title> + + <para> + Hime is an extremely easy-to-use input method framework. It is lightweight, + stable, powerful and supports many commonly used input methods, including + Cangjie, Zhuyin, Dayi, Rank, Shrimp, Greek, Japanese Anthy, Korean Pinyin, + Latin Alphabet, Rancang hunting birds, cool music, etc... + </para> + + <para> + The following snippet can be used to configure Hime: + </para> + +<programlisting> +i18n.inputMethod = { + <link linkend="opt-i18n.inputMethod.enabled">enabled</link> = "hime"; +}; +</programlisting> + </section> </chapter> diff --git a/nixos/modules/i18n/input-method/hime.nix b/nixos/modules/i18n/input-method/hime.nix new file mode 100644 index 000000000000..a1b346a0f840 --- /dev/null +++ b/nixos/modules/i18n/input-method/hime.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: + +with lib; +{ + options = { + i18n.inputMethod.hime = { + enableChewing = mkOption { + type = with types; nullOr bool; + default = null; + description = "enable chewing input method"; + }; + enableAnthy = mkOption { + type = with types; nullOr bool; + default = null; + description = "enable anthy input method"; + }; + }; + }; + + config = mkIf (config.i18n.inputMethod.enabled == "hime") { + environment.variables = { + GTK_IM_MODULE = "hime"; + QT_IM_MODULE = "hime"; + XMODIFIERS = "@im=hime"; + }; + services.xserver.displayManager.sessionCommands = "${pkgs.hime}/bin/hime &"; + }; +} |