mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
kime: fix configuration
Switches the kime configuration format to use unstructured text. This is necessary since version 3 and upwards use YAML tags.
This commit is contained in:
parent
7b3fca5adc
commit
865bef3435
2 changed files with 56 additions and 27 deletions
|
|
@ -1,34 +1,33 @@
|
|||
{ config, pkgs, lib, generators, ... }:
|
||||
with lib;
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) literalExpression mkIf mkOption mkRemovedOptionModule types;
|
||||
|
||||
cfg = config.i18n.inputMethod.kime;
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
in {
|
||||
imports = [
|
||||
(mkRemovedOptionModule [ "i18n" "inputMethod" "kime" "config" ] ''
|
||||
Please use 'i18n.inputMethod.kime.extraConfig' instead.
|
||||
'')
|
||||
];
|
||||
|
||||
options = {
|
||||
i18n.inputMethod.kime = {
|
||||
config = mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = literalExpression ''
|
||||
{
|
||||
daemon = {
|
||||
modules = ["Xim" "Indicator"];
|
||||
};
|
||||
|
||||
indicator = {
|
||||
icon_color = "White";
|
||||
};
|
||||
|
||||
engine = {
|
||||
hangul = {
|
||||
layout = "dubeolsik";
|
||||
};
|
||||
};
|
||||
}
|
||||
daemon:
|
||||
modules: [Xim,Indicator]
|
||||
indicator:
|
||||
icon_color: White
|
||||
engine:
|
||||
hangul:
|
||||
layout: dubeolsik
|
||||
'';
|
||||
description = ''
|
||||
kime configuration. Refer to
|
||||
<https://github.com/Riey/kime/blob/develop/docs/CONFIGURATION.md>
|
||||
<https://github.com/Riey/kime/blob/v${pkgs.kime.version}/docs/CONFIGURATION.md>
|
||||
for details on supported values.
|
||||
'';
|
||||
};
|
||||
|
|
@ -44,8 +43,7 @@ in {
|
|||
XMODIFIERS = "@im=kime";
|
||||
};
|
||||
|
||||
xdg.configFile."kime/config.yaml".text =
|
||||
replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config);
|
||||
xdg.configFile."kime/config.yaml".text = cfg.extraConfig;
|
||||
|
||||
systemd.user.services.kime-daemon = {
|
||||
Unit = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue