2023-10-07 18:06:10 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
2021-06-16 00:59:25 +02:00
|
|
|
let
|
2023-10-07 18:06:10 +02:00
|
|
|
inherit (lib) literalExpression mkIf mkOption mkRemovedOptionModule types;
|
|
|
|
|
2021-06-16 00:59:25 +02:00
|
|
|
cfg = config.i18n.inputMethod.kime;
|
|
|
|
in {
|
2023-10-07 18:06:10 +02:00
|
|
|
imports = [
|
|
|
|
(mkRemovedOptionModule [ "i18n" "inputMethod" "kime" "config" ] ''
|
|
|
|
Please use 'i18n.inputMethod.kime.extraConfig' instead.
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
2021-06-16 00:59:25 +02:00
|
|
|
options = {
|
|
|
|
i18n.inputMethod.kime = {
|
2023-10-07 18:06:10 +02:00
|
|
|
extraConfig = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2023-10-07 18:06:10 +02:00
|
|
|
daemon:
|
|
|
|
modules: [Xim,Indicator]
|
|
|
|
indicator:
|
|
|
|
icon_color: White
|
|
|
|
engine:
|
|
|
|
hangul:
|
|
|
|
layout: dubeolsik
|
2021-06-16 00:59:25 +02:00
|
|
|
'';
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2021-06-16 00:59:25 +02:00
|
|
|
kime configuration. Refer to
|
2024-03-18 22:13:07 +01: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";
|
|
|
|
};
|
|
|
|
|
2023-10-07 18:06:10 +02:00
|
|
|
xdg.configFile."kime/config.yaml".text = cfg.extraConfig;
|
2021-06-16 00:59:25 +02:00
|
|
|
|
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|