diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index e23f1b562e71..4ef80cb39cb1 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -128,6 +128,8 @@ In addition to numerous new and upgraded packages, this release has the followin - The [services.unifi-video.openFirewall](#opt-services.unifi-video.openFirewall) module option default value has been changed from `true` to `false`. You will need to explicitly set this option to `true`, or configure your firewall. +- The option `i18n.inputMethod.fcitx5.enableRimeData` has been removed. Default RIME data is now included in `fcitx5-rime` by default, and can be customized using `fcitx5-rime.override { rimeDataPkgs = [ pkgs.rime-data, package2, ... ]; }` + - Kime has been updated from 2.5.6 to 3.0.2 and the `i18n.inputMethod.kime.config` option has been removed. Users should use `daemonModules`, `iconColor`, and `extraConfig` options under `i18n.inputMethod.kime` instead. - `tut` has been updated from 1.0.34 to 2.0.0, and now uses the TOML format for the configuration file instead of INI. Additional information can be found [here](https://github.com/RasmusLindroth/tut/releases/tag/2.0.0). diff --git a/nixos/modules/i18n/input-method/fcitx5.nix b/nixos/modules/i18n/input-method/fcitx5.nix index aa816c90a3de..7251240d26ac 100644 --- a/nixos/modules/i18n/input-method/fcitx5.nix +++ b/nixos/modules/i18n/input-method/fcitx5.nix @@ -5,10 +5,9 @@ with lib; let im = config.i18n.inputMethod; cfg = im.fcitx5; - addons = cfg.addons ++ optional cfg.enableRimeData pkgs.rime-data; - fcitx5Package = pkgs.fcitx5-with-addons.override { inherit addons; }; - whetherRimeDataDir = any (p: p.pname == "fcitx5-rime") cfg.addons; -in { + fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; }; +in +{ options = { i18n.inputMethod.fcitx5 = { addons = mkOption { @@ -19,30 +18,23 @@ in { Enabled Fcitx5 addons. ''; }; - - enableRimeData = mkEnableOption (lib.mdDoc "default rime-data with fcitx5-rime"); }; }; + 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 = ...; }` + '') + ]; + config = mkIf (im.enabled == "fcitx5") { i18n.inputMethod.package = fcitx5Package; - environment = mkMerge [{ - variables = { - GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; - XMODIFIERS = "@im=fcitx"; - QT_PLUGIN_PATH = [ "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; - }; - } - (mkIf whetherRimeDataDir { - pathsToLink = [ - "/share/rime-data" - ]; - - variables = { - NIX_RIME_DATA_DIR = "/run/current-system/sw/share/rime-data"; - }; - })]; + environment.variables = { + GTK_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; + XMODIFIERS = "@im=fcitx"; + QT_PLUGIN_PATH = [ "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; + }; }; } diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime-with-nix-env-variable.patch b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime-with-nix-env-variable.patch deleted file mode 100644 index 428a0232dc3b..000000000000 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime-with-nix-env-variable.patch +++ /dev/null @@ -1,18 +0,0 @@ -:100644 100644 fac4f53 aed9617 M src/rimeengine.cpp - -diff --git a/src/rimeengine.cpp b/src/rimeengine.cpp -index fac4f53..aed9617 100644 ---- a/src/rimeengine.cpp -+++ b/src/rimeengine.cpp -@@ -164,7 +164,10 @@ void RimeEngine::rimeStart(bool fullcheck) { - RIME_ERROR() << "Failed to create user directory: " << userDir; - } - } -- const char *sharedDataDir = RIME_DATA_DIR; -+ const char *sharedDataDir = getenv("NIX_RIME_DATA_DIR"); -+ if (!sharedDataDir) { -+ sharedDataDir = RIME_DATA_DIR; -+ } - - RIME_STRUCT(RimeTraits, fcitx_rime_traits); - fcitx_rime_traits.shared_data_dir = sharedDataDir; diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix index 03150b43c477..4249567635cf 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-rime.nix @@ -6,6 +6,9 @@ , gettext , fcitx5 , librime +, rime-data +, symlinkJoin +, rimeDataPkgs ? [ rime-data ] }: stdenv.mkDerivation rec { @@ -35,7 +38,14 @@ stdenv.mkDerivation rec { librime ]; - patches = [ ./fcitx5-rime-with-nix-env-variable.patch ]; + rimeDataDrv = symlinkJoin { + name = "fcitx5-rime-data"; + paths = rimeDataPkgs; + }; + + postInstall = '' + cp -r "${rimeDataDrv}/share/rime-data/." $out/share/rime-data/ + ''; meta = with lib; { description = "RIME support for Fcitx5"; diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix index d415b6b5a45d..774978929b40 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix @@ -9,6 +9,8 @@ , librime , pkg-config , rime-data +, symlinkJoin +, rimeDataPkgs ? [ rime-data ] }: stdenv.mkDerivation rec { @@ -22,15 +24,18 @@ stdenv.mkDerivation rec { sha256 = "0gdxg6ia0i31jn3cvh1nrsjga1j31hf8a2zfgg8rzn25chrfr319"; }; - buildInputs = [ gdk-pixbuf glib ibus libnotify librime rime-data ]; + buildInputs = [ gdk-pixbuf glib ibus libnotify librime ]; nativeBuildInputs = [ cmake pkg-config ]; - cmakeFlags = [ "-DRIME_DATA_DIR=${rime-data}/share/rime-data" ]; + cmakeFlags = [ "-DRIME_DATA_DIR=${placeholder "out"}/share/rime-data" ]; - prePatch = '' - substituteInPlace CMakeLists.txt \ - --replace 'DESTINATION "''${RIME_DATA_DIR}"' \ - 'DESTINATION "''${CMAKE_INSTALL_DATADIR}/rime-data"' + rimeDataDrv = symlinkJoin { + name = "ibus-rime-data"; + paths = rimeDataPkgs; + }; + + postInstall = '' + cp -r "${rimeDataDrv}/share/rime-data/." $out/share/rime-data/ ''; meta = with lib; {