nixpkgs/nixos/modules/i18n/input-method/kime.nix
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00

54 lines
1.5 KiB
Nix

{ config, pkgs, lib, generators, ... }:
let imcfg = config.i18n.inputMethod;
in {
imports = [
(lib.mkRemovedOptionModule [ "i18n" "inputMethod" "kime" "config" ] "Use i18n.inputMethod.kime.* instead")
];
options.i18n.inputMethod.kime = {
daemonModules = lib.mkOption {
type = lib.types.listOf (lib.types.enum [ "Xim" "Wayland" "Indicator" ]);
default = [ "Xim" "Wayland" "Indicator" ];
example = [ "Xim" "Indicator" ];
description = ''
List of enabled daemon modules
'';
};
iconColor = lib.mkOption {
type = lib.types.enum [ "Black" "White" ];
default = "Black";
example = "White";
description = ''
Color of the indicator icon
'';
};
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = ''
extra kime configuration. Refer to <https://github.com/Riey/kime/blob/v${pkgs.kime.version}/docs/CONFIGURATION.md> for details on supported values.
'';
};
};
config = lib.mkIf (imcfg.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 = ''
daemon:
modules: [${lib.concatStringsSep "," imcfg.kime.daemonModules}]
indicator:
icon_color: ${imcfg.kime.iconColor}
'' + imcfg.kime.extraConfig;
};
# uses attributes of the linked package
meta.buildDocsInSandbox = false;
}