input methods: add kime
This commit is contained in:
parent
7ba68694a0
commit
767cc9fa4d
4 changed files with 74 additions and 1 deletions
|
@ -29,7 +29,7 @@ in
|
|||
options.i18n = {
|
||||
inputMethod = {
|
||||
enabled = mkOption {
|
||||
type = types.nullOr (types.enum [ "ibus" "fcitx" "fcitx5" "nabi" "uim" "hime" ]);
|
||||
type = types.nullOr (types.enum [ "ibus" "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]);
|
||||
default = null;
|
||||
example = "fcitx";
|
||||
description = ''
|
||||
|
@ -46,6 +46,7 @@ in
|
|||
<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>
|
||||
<listitem><para>kime: Koream IME.</para></listitem>
|
||||
</itemizedlist>
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
Hime: An extremely easy-to-use input method framework.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Kime: Korean IME
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<section xml:id="module-services-input-methods-ibus">
|
||||
<title>IBus</title>
|
||||
|
@ -264,6 +269,23 @@ i18n.inputMethod = {
|
|||
i18n.inputMethod = {
|
||||
<link linkend="opt-i18n.inputMethod.enabled">enabled</link> = "hime";
|
||||
};
|
||||
</programlisting>
|
||||
</section>
|
||||
<section xml:id="module-services-input-methods-kime">
|
||||
<title>Kime</title>
|
||||
|
||||
<para>
|
||||
Kime is Korean IME. it's built with Rust language and let you get simple, safe, fast Korean typing
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following snippet can be used to configure Kime:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
i18n.inputMethod = {
|
||||
<link linkend="opt-i18n.inputMethod.enabled">enabled</link> = "kime";
|
||||
};
|
||||
</programlisting>
|
||||
</section>
|
||||
</chapter>
|
||||
|
|
49
nixos/modules/i18n/input-method/kime.nix
Normal file
49
nixos/modules/i18n/input-method/kime.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ config, pkgs, lib, generators, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.i18n.inputMethod.kime;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in
|
||||
{
|
||||
options = {
|
||||
i18n.inputMethod.kime = {
|
||||
config = mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = literalExample ''
|
||||
{
|
||||
daemon = {
|
||||
modules = ["Xim" "Indicator"];
|
||||
};
|
||||
|
||||
indicator = {
|
||||
icon_color = "White";
|
||||
};
|
||||
|
||||
engine = {
|
||||
hangul = {
|
||||
layout = "dubeolsik";
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
kime configuration. Refer to <link xlink:href="https://github.com/Riey/kime/blob/v${pkgs.kime.version}/docs/CONFIGURATION.md"/> for details on supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (config.i18n.inputMethod.enabled == "kime") {
|
||||
i18n.inputMethod.package = pkgs.kime;
|
||||
|
||||
environment.variables = {
|
||||
GTK_IM_MODULE = "kime";
|
||||
QT_IM_MODULE = "kime";
|
||||
XMODIFIERS = "@im=kime";
|
||||
};
|
||||
|
||||
environment.etc."xdg/kime/config.yaml".text = replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
|
||||
};
|
||||
}
|
||||
|
|
@ -92,6 +92,7 @@
|
|||
./i18n/input-method/ibus.nix
|
||||
./i18n/input-method/nabi.nix
|
||||
./i18n/input-method/uim.nix
|
||||
./i18n/input-method/kime.nix
|
||||
./installer/tools/tools.nix
|
||||
./misc/assertions.nix
|
||||
./misc/crashdump.nix
|
||||
|
|
Loading…
Reference in a new issue