1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-05 01:19:46 +01:00
home-manager/modules/i18n/input-method/kime.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
2021-06-16 00:59:25 +02:00
let
inherit (lib) literalExpression mkIf mkOption mkRemovedOptionModule types;
2021-06-16 00:59:25 +02:00
cfg = config.i18n.inputMethod.kime;
in {
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 = {
extraConfig = mkOption {
type = types.lines;
default = "";
example = literalExpression ''
daemon:
modules: [Xim,Indicator]
indicator:
icon_color: White
engine:
hangul:
layout: dubeolsik
2021-06-16 00:59:25 +02:00
'';
description = ''
2021-06-16 00:59:25 +02:00
kime configuration. Refer to
<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 = cfg.extraConfig;
2021-06-16 00:59:25 +02:00
systemd.user.services.kime-daemon = {
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" ];
};
};
}