diff --git a/modules/i18n/input-method/default.nix b/modules/i18n/input-method/default.nix index 27b3ae86..e0d95e6f 100644 --- a/modules/i18n/input-method/default.nix +++ b/modules/i18n/input-method/default.nix @@ -22,8 +22,7 @@ let ''; in { - imports = - [ ./fcitx.nix ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ]; + imports = [ ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ]; options.i18n = { inputMethod = { @@ -31,7 +30,7 @@ in { type = types.nullOr (types.enum [ "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]); default = null; - example = "fcitx"; + example = "fcitx5"; description = '' Select the enabled input method. Input methods is a software to input symbols that are not available on standard input devices. @@ -42,17 +41,10 @@ in { Currently the following input methods are available in Home Manager: - - fcitx - - A customizable lightweight input method - extra input engines can be added using - i18n.inputMethod.fcitx.engines. - - fcitx5 + A customizable lightweight input method. The next generation of fcitx, addons (including engines, dictionaries, skins) can be added using i18n.inputMethod.fcitx5.addons. @@ -97,6 +89,10 @@ in { config = mkIf (cfg.enabled != null) { assertions = [ (hm.assertions.assertPlatform "i18n.inputMethod" pkgs platforms.linux) + { + assertion = cfg.enabled != "fcitx"; + message = "fcitx has been removed, please use fcitx5 instead"; + } ]; home.packages = [ cfg.package gtk2Cache gtk3Cache ]; diff --git a/modules/i18n/input-method/fcitx.nix b/modules/i18n/input-method/fcitx.nix deleted file mode 100644 index f7d1b41a..00000000 --- a/modules/i18n/input-method/fcitx.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ config, pkgs, lib, ... }: - -with lib; - -let - cfg = config.i18n.inputMethod.fcitx; - fcitxPackage = pkgs.fcitx.override { plugins = cfg.engines; }; - fcitxEngine = types.package // { - name = "fcitx-engine"; - check = x: - types.package.check x && attrByPath [ "meta" "isFcitxEngine" ] false x; - }; -in { - options = { - - i18n.inputMethod.fcitx = { - engines = mkOption { - type = with types; listOf fcitxEngine; - default = [ ]; - example = literalExpression "with pkgs.fcitx-engines; [ mozc hangul ]"; - description = let - enginesDrv = filterAttrs (const isDerivation) pkgs.fcitx-engines; - engines = concatStringsSep ", " - (map (name: "${name}") (attrNames enginesDrv)); - in "Enabled Fcitx engines. Available engines are: ${engines}."; - }; - }; - - }; - - config = mkIf (config.i18n.inputMethod.enabled == "fcitx") { - i18n.inputMethod.package = fcitxPackage; - - home.sessionVariables = { - GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - }; - - systemd.user.services.fcitx-daemon = { - Unit = { - Description = "Fcitx input method editor"; - PartOf = [ "graphical-session.desktop" ]; - }; - Service.ExecStart = "${fcitxPackage}/bin/fcitx"; - Install.WantedBy = [ "graphical-session.target" ]; - }; - }; - -}