2020-12-13 03:29:58 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
im = config.i18n.inputMethod;
|
|
|
|
cfg = im.fcitx5;
|
2023-04-01 07:12:19 +00:00
|
|
|
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
|
|
|
|
in
|
|
|
|
{
|
2021-06-01 23:50:11 +00:00
|
|
|
options = {
|
|
|
|
i18n.inputMethod.fcitx5 = {
|
|
|
|
addons = mkOption {
|
|
|
|
type = with types; listOf package;
|
|
|
|
default = [];
|
2021-10-03 16:06:03 +00:00
|
|
|
example = literalExpression "with pkgs; [ fcitx5-rime ]";
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc ''
|
2021-06-01 23:50:11 +00:00
|
|
|
Enabled Fcitx5 addons.
|
|
|
|
'';
|
2020-12-13 03:29:58 +00:00
|
|
|
};
|
|
|
|
};
|
2021-06-01 23:50:11 +00:00
|
|
|
};
|
2020-12-13 03:29:58 +00:00
|
|
|
|
2023-04-01 07:12:19 +00:00
|
|
|
imports = [
|
|
|
|
(mkRemovedOptionModule [ "i18n" "inputMethod" "fcitx5" "enableRimeData" ] ''
|
|
|
|
RIME data is now included in `fcitx5-rime` by default, and can be customized using `fcitx5-rime.override { rimeDataPkgs = ...; }`
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
|
2021-06-01 23:50:11 +00:00
|
|
|
config = mkIf (im.enabled == "fcitx5") {
|
|
|
|
i18n.inputMethod.package = fcitx5Package;
|
2020-12-13 03:29:58 +00:00
|
|
|
|
2023-04-01 07:12:19 +00:00
|
|
|
environment.variables = {
|
|
|
|
GTK_IM_MODULE = "fcitx";
|
|
|
|
QT_IM_MODULE = "fcitx";
|
|
|
|
XMODIFIERS = "@im=fcitx";
|
|
|
|
QT_PLUGIN_PATH = [ "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ];
|
|
|
|
};
|
2021-06-01 23:50:11 +00:00
|
|
|
};
|
|
|
|
}
|