2021-04-17 16:31:42 +01:00
|
|
|
{ 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 = { };
|
2021-10-03 17:06:03 +01:00
|
|
|
example = literalExpression ''
|
2021-04-17 16:31:42 +01:00
|
|
|
{
|
|
|
|
daemon = {
|
|
|
|
modules = ["Xim" "Indicator"];
|
|
|
|
};
|
|
|
|
|
|
|
|
indicator = {
|
|
|
|
icon_color = "White";
|
|
|
|
};
|
|
|
|
|
|
|
|
engine = {
|
|
|
|
hangul = {
|
|
|
|
layout = "dubeolsik";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
'';
|
2022-07-28 22:19:15 +01:00
|
|
|
description = lib.mdDoc ''
|
|
|
|
kime configuration. Refer to <https://github.com/Riey/kime/blob/v${pkgs.kime.version}/docs/CONFIGURATION.md> for details on supported values.
|
2021-04-17 16:31:42 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2021-11-18 23:26:27 +00:00
|
|
|
# uses attributes of the linked package
|
|
|
|
meta.buildDocsInSandbox = false;
|
|
|
|
}
|