2021-12-11 05:16:45 +00:00
|
|
|
# Instant setup for using internationalized languages.
|
2021-11-29 09:56:24 +00:00
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
2022-01-09 05:38:59 +00:00
|
|
|
let cfg = config.profiles.i18n;
|
2021-12-11 05:16:45 +00:00
|
|
|
in {
|
2022-01-09 05:38:59 +00:00
|
|
|
options.profiles.i18n.enable =
|
2021-12-11 05:16:45 +00:00
|
|
|
lib.mkEnableOption "fcitx5 as input method engine";
|
2021-11-29 09:56:24 +00:00
|
|
|
|
2021-12-11 05:16:45 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
fonts.fontconfig.enable = true;
|
|
|
|
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
noto-fonts
|
|
|
|
noto-fonts-cjk
|
2022-07-13 13:50:31 +00:00
|
|
|
noto-fonts-cjk-sans
|
|
|
|
noto-fonts-cjk-serif
|
2021-12-11 05:16:45 +00:00
|
|
|
noto-fonts-extra
|
|
|
|
noto-fonts-emoji
|
|
|
|
];
|
|
|
|
|
|
|
|
i18n.inputMethod = {
|
|
|
|
enabled = "fcitx5";
|
|
|
|
fcitx5.addons = with pkgs; [
|
|
|
|
fcitx5-gtk # Add support for GTK-based programs.
|
|
|
|
libsForQt5.fcitx5-qt # Add support for QT-based programs.
|
|
|
|
fcitx5-lua # Add Lua support.
|
|
|
|
fcitx5-rime # Chinese input addon.
|
|
|
|
fcitx5-mozc # Japanese input addon.
|
2022-07-13 13:50:31 +00:00
|
|
|
fcitx5-table-extra
|
|
|
|
fcitx5-table-other
|
2021-12-11 05:16:45 +00:00
|
|
|
];
|
2021-11-29 09:56:24 +00:00
|
|
|
};
|
2021-12-26 08:02:57 +00:00
|
|
|
|
|
|
|
# The i18n module has already set session variables but just to be sure...
|
|
|
|
systemd.user.sessionVariables = {
|
|
|
|
GTK_IM_MODULE = "fcitx";
|
|
|
|
QT_IM_MODULE = "fcitx";
|
|
|
|
XMODIFIERS = "@im=fcitx";
|
|
|
|
};
|
2021-12-11 05:16:45 +00:00
|
|
|
};
|
|
|
|
}
|