From 0db47bd50ee411b5ca291e86f5daa0ee668a600a Mon Sep 17 00:00:00 2001 From: Riey Date: Sat, 26 Nov 2022 00:29:05 +0900 Subject: [PATCH] kime: 2.5.6 -> 3.0.2 --- .../from_md/release-notes/rl-2305.section.xml | 11 +++ .../manual/release-notes/rl-2305.section.md | 2 + nixos/modules/i18n/input-method/kime.nix | 68 ++++++++++--------- pkgs/tools/inputmethods/kime/default.nix | 22 +++--- 4 files changed, 61 insertions(+), 42 deletions(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml index a672deb20b64..1a9d3bdb6c6b 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml @@ -276,6 +276,17 @@ or configure your firewall. + + + 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. + + llvmPackages_rocm.llvm will not contain diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index c0518d4cd6f0..2563da719f62 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -71,6 +71,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. +- 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. + - `llvmPackages_rocm.llvm` will not contain `clang` or `compiler-rt`. `llvmPackages_rocm.clang` will not contain `llvm`. `llvmPackages_rocm.clangNoCompilerRt` has been removed in favor of using `llvmPackages_rocm.clang-unwrapped`. - The EC2 image module previously detected and automatically mounted ext3-formatted instance store devices and partitions in stage-1 (initramfs), storing `/tmp` on the first discovered device. This behaviour, which only catered to very specific use cases and could not be disabled, has been removed. Users relying on this should provide their own implementation, and probably use ext4 and perform the mount in stage-2. diff --git a/nixos/modules/i18n/input-method/kime.nix b/nixos/modules/i18n/input-method/kime.nix index 29224a6bf75f..e82996926b28 100644 --- a/nixos/modules/i18n/input-method/kime.nix +++ b/nixos/modules/i18n/input-method/kime.nix @@ -1,40 +1,37 @@ { config, pkgs, lib, generators, ... }: -with lib; -let - cfg = config.i18n.inputMethod.kime; - yamlFormat = pkgs.formats.yaml { }; -in -{ - options = { - i18n.inputMethod.kime = { - config = mkOption { - type = yamlFormat.type; - default = { }; - example = literalExpression '' - { - daemon = { - modules = ["Xim" "Indicator"]; - }; +let imcfg = config.i18n.inputMethod; +in { + imports = [ + (lib.mkRemovedOptionModule [ "i18n" "inputMethod" "kime" "config" ] "Use i18n.inputMethod.kime.* instead") + ]; - indicator = { - icon_color = "White"; - }; - - engine = { - hangul = { - layout = "dubeolsik"; - }; - }; - } - ''; - description = lib.mdDoc '' - kime configuration. Refer to for details on supported values. - ''; - }; + options.i18n.inputMethod.kime = { + daemonModules = lib.mkOption { + type = lib.types.listOf (lib.types.enum [ "Xim" "Wayland" "Indicator" ]); + default = [ "Xim" "Wayland" "Indicator" ]; + example = [ "Xim" "Indicator" ]; + description = lib.mdDoc '' + List of enabled daemon modules + ''; + }; + iconColor = lib.mkOption { + type = lib.types.enum [ "Black" "White" ]; + default = "Black"; + example = "White"; + description = lib.mdDoc '' + Color of the indicator icon + ''; + }; + extraConfig = lib.mkOption { + type = lib.types.lines; + default = ""; + description = lib.mdDoc '' + extra kime configuration. Refer to for details on supported values. + ''; }; }; - config = mkIf (config.i18n.inputMethod.enabled == "kime") { + config = lib.mkIf (imcfg.enabled == "kime") { i18n.inputMethod.package = pkgs.kime; environment.variables = { @@ -43,7 +40,12 @@ in XMODIFIERS = "@im=kime"; }; - environment.etc."xdg/kime/config.yaml".text = replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config); + environment.etc."xdg/kime/config.yaml".text = '' + daemon: + modules: [${lib.concatStringsSep "," imcfg.kime.daemonModules}] + indicator: + icon_color: ${imcfg.kime.iconColor} + '' + imcfg.kime.extraConfig; }; # uses attributes of the linked package diff --git a/pkgs/tools/inputmethods/kime/default.nix b/pkgs/tools/inputmethods/kime/default.nix index 68a91d2bfca7..fc69d47a14fc 100644 --- a/pkgs/tools/inputmethods/kime/default.nix +++ b/pkgs/tools/inputmethods/kime/default.nix @@ -2,32 +2,34 @@ , withWayland ? true , withIndicator ? true, dbus, libdbusmenu , withXim ? true, xorg, cairo -, withGtk2 ? true, gtk2 , withGtk3 ? true, gtk3 +, withGtk4 ? true, gtk4 , withQt5 ? true, qt5 +, withQt6 ? false, qt6 }: let - cmake_args = lib.optionals withGtk2 ["-DENABLE_GTK2=ON"] - ++ lib.optionals withGtk3 ["-DENABLE_GTK3=ON"] - ++ lib.optionals withQt5 ["-DENABLE_QT5=ON"]; + cmake_args = lib.optionals withGtk3 ["-DENABLE_GTK3=ON"] + ++ lib.optionals withGtk4 ["-DENABLE_GTK4=ON"] + ++ lib.optionals withQt5 ["-DENABLE_QT5=ON"] + ++ lib.optionals withQt6 ["-DENABLE_QT6=ON"]; optFlag = w: (if w then "1" else "0"); in stdenv.mkDerivation rec { pname = "kime"; - version = "2.5.6"; + version = "3.0.2"; src = fetchFromGitHub { owner = "Riey"; repo = pname; rev = "v${version}"; - sha256 = "sha256-r5luI6B4IjNTbh2tzpqabokgwkmbyXrA61+F2HDEWuo="; + sha256 = "sha256-qLQ6DmV7KHhdXWR5KtO52cmXBm818zKJVj4nxsR14dc="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; - sha256 = "sha256-GvBnNPY51RPt+I73oet5tB/EE2UsEPKbelJZkSY3xNw="; + sha256 = "sha256-/o9b7YvrpV+IujkllFWAz6Mg4CbS9BInF8antfZ0Vsw="; }; # Replace autostart path @@ -68,6 +70,7 @@ stdenv.mkDerivation rec { export KIME_ICON_DIR=share/icons export KIME_LIB_DIR=lib export KIME_QT5_DIR=lib/qt-${qt5.qtbase.version} + export KIME_QT6_DIR=lib/qt-${qt6.qtbase.version} bash scripts/install.sh "$out" runHook postInstall ''; @@ -84,9 +87,10 @@ stdenv.mkDerivation rec { buildInputs = lib.optionals withIndicator [ dbus libdbusmenu ] ++ lib.optionals withXim [ xorg.libxcb cairo ] - ++ lib.optionals withGtk2 [ gtk2 ] ++ lib.optionals withGtk3 [ gtk3 ] - ++ lib.optionals withQt5 [ qt5.qtbase ]; + ++ lib.optionals withGtk4 [ gtk4 ] + ++ lib.optionals withQt5 [ qt5.qtbase ] + ++ lib.optionals withQt6 [ qt6.qtbase ]; nativeBuildInputs = [ pkg-config