nixos-config/modules/home-manager/profiles/i18n.nix
Gabriel Arazas 6b481a163a Restructure the modules
While it is easier to maintain the modules by prefixing them all with
`modules`, it is not easy when used from other flakes and/or modules.
This is my attempt on making it easier with appropriate namespaces.

Update home-manager user from the restructure
2022-01-09 19:44:09 +08:00

38 lines
990 B
Nix

# Instant setup for using internationalized languages.
{ config, options, lib, pkgs, ... }:
let cfg = config.profiles.i18n;
in {
options.profiles.i18n.enable =
lib.mkEnableOption "fcitx5 as input method engine";
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = true;
home.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
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.
];
};
# 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";
};
};
}