forked from mirrors/nixpkgs
nixos/input-methods: add fcitx5
This commit is contained in:
parent
1b06ca4b0d
commit
14227a94b2
|
@ -29,7 +29,7 @@ in
|
||||||
options.i18n = {
|
options.i18n = {
|
||||||
inputMethod = {
|
inputMethod = {
|
||||||
enabled = mkOption {
|
enabled = mkOption {
|
||||||
type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" "hime" ]);
|
type = types.nullOr (types.enum [ "ibus" "fcitx" "fcitx5" "nabi" "uim" "hime" ]);
|
||||||
default = null;
|
default = null;
|
||||||
example = "fcitx";
|
example = "fcitx";
|
||||||
description = ''
|
description = ''
|
||||||
|
|
33
nixos/modules/i18n/input-method/fcitx5.nix
Normal file
33
nixos/modules/i18n/input-method/fcitx5.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -82,6 +82,7 @@
|
||||||
./hardware/xpadneo.nix
|
./hardware/xpadneo.nix
|
||||||
./i18n/input-method/default.nix
|
./i18n/input-method/default.nix
|
||||||
./i18n/input-method/fcitx.nix
|
./i18n/input-method/fcitx.nix
|
||||||
|
./i18n/input-method/fcitx5.nix
|
||||||
./i18n/input-method/hime.nix
|
./i18n/input-method/hime.nix
|
||||||
./i18n/input-method/ibus.nix
|
./i18n/input-method/ibus.nix
|
||||||
./i18n/input-method/nabi.nix
|
./i18n/input-method/nabi.nix
|
||||||
|
|
Loading…
Reference in a new issue