nixos/input-methods: add fcitx5

Poscat 14227a94 1b06ca4b

Changed files
+35 -1
nixos
modules
+1 -1
nixos/modules/i18n/input-method/default.nix
···
options.i18n = {
inputMethod = {
enabled = mkOption {
-
type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" "hime" ]);
default = null;
example = "fcitx";
description = ''
···
options.i18n = {
inputMethod = {
enabled = mkOption {
+
type = types.nullOr (types.enum [ "ibus" "fcitx" "fcitx5" "nabi" "uim" "hime" ]);
default = null;
example = "fcitx";
description = ''
+33
nixos/modules/i18n/input-method/fcitx5.nix
···
···
+
{ config, pkgs, lib, ... }:
+
+
with lib;
+
+
let
+
im = config.i18n.inputMethod;
+
cfg = im.fcitx5;
+
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
+
in
+
{
+
options = {
+
i18n.inputMethod.fcitx5 = {
+
addons = mkOption {
+
type = with types; listOf package;
+
default = [];
+
example = with pkgs; [ fcitx5-rime ];
+
description = ''
+
Enabled Fcitx5 addons.
+
'';
+
};
+
};
+
};
+
+
config = mkIf (im.enabled == "fcitx5") {
+
i18n.inputMethod.package = fcitx5Package;
+
+
environment.variables = {
+
GTK_IM_MODULE = "fcitx";
+
QT_IM_MODULE = "fcitx";
+
XMODIFIERS = "@im=fcitx";
+
};
+
};
+
}
+1
nixos/modules/module-list.nix
···
./hardware/xpadneo.nix
./i18n/input-method/default.nix
./i18n/input-method/fcitx.nix
./i18n/input-method/hime.nix
./i18n/input-method/ibus.nix
./i18n/input-method/nabi.nix
···
./hardware/xpadneo.nix
./i18n/input-method/default.nix
./i18n/input-method/fcitx.nix
+
./i18n/input-method/fcitx5.nix
./i18n/input-method/hime.nix
./i18n/input-method/ibus.nix
./i18n/input-method/nabi.nix