2021-06-16 00:59:25 +02: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-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2021-06-16 00:59:25 +02:00
|
|
|
{
|
|
|
|
daemon = {
|
|
|
|
modules = ["Xim" "Indicator"];
|
|
|
|
};
|
|
|
|
|
|
|
|
indicator = {
|
|
|
|
icon_color = "White";
|
|
|
|
};
|
|
|
|
|
|
|
|
engine = {
|
|
|
|
hangul = {
|
|
|
|
layout = "dubeolsik";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
'';
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2021-06-16 00:59:25 +02:00
|
|
|
kime configuration. Refer to
|
2023-07-01 01:30:13 +02:00
|
|
|
<https://github.com/Riey/kime/blob/develop/docs/CONFIGURATION.md>
|
2021-06-16 00:59:25 +02:00
|
|
|
for details on supported values.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (config.i18n.inputMethod.enabled == "kime") {
|
|
|
|
i18n.inputMethod.package = pkgs.kime;
|
|
|
|
|
|
|
|
home.sessionVariables = {
|
|
|
|
GTK_IM_MODULE = "kime";
|
|
|
|
QT_IM_MODULE = "kime";
|
|
|
|
XMODIFIERS = "@im=kime";
|
|
|
|
};
|
|
|
|
|
|
|
|
xdg.configFile."kime/config.yaml".text =
|
|
|
|
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
|
|
|
|
|
|
|
|
systemd.user.services.kime-daemon = {
|
2022-01-17 19:53:42 +01:00
|
|
|
Unit = {
|
|
|
|
Description = "Kime input method editor";
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
};
|
2021-06-16 00:59:25 +02:00
|
|
|
Service.ExecStart = "${pkgs.kime}/bin/kime";
|
|
|
|
Install.WantedBy = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|