From a69f3e9b0390f03defb834b15e80c236a537157d Mon Sep 17 00:00:00 2001 From: Subin Kim <32478597+sudosubin@users.noreply.github.com> Date: Tue, 18 Jan 2022 03:53:42 +0900 Subject: [PATCH] kime: Fix kime systemd service broken (#2621) * kime: Fix kime systemd service * kime: Add test case * kime: Add test stub package --- modules/i18n/input-method/kime.nix | 7 ++++--- tests/modules/i18n/input-method/default.nix | 5 ++++- .../i18n/input-method/kime-configuration.nix | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 tests/modules/i18n/input-method/kime-configuration.nix diff --git a/modules/i18n/input-method/kime.nix b/modules/i18n/input-method/kime.nix index 4a84768e..70f32190 100644 --- a/modules/i18n/input-method/kime.nix +++ b/modules/i18n/input-method/kime.nix @@ -48,11 +48,12 @@ in { replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config); systemd.user.services.kime-daemon = { - Unit = { Description = "Kime input method editor"; }; - PartOf = [ "graphical-session.target" ]; + Unit = { + Description = "Kime input method editor"; + PartOf = [ "graphical-session.target" ]; + }; Service.ExecStart = "${pkgs.kime}/bin/kime"; Install.WantedBy = [ "graphical-session.target" ]; }; }; - } diff --git a/tests/modules/i18n/input-method/default.nix b/tests/modules/i18n/input-method/default.nix index f214d851..a9d5764d 100644 --- a/tests/modules/i18n/input-method/default.nix +++ b/tests/modules/i18n/input-method/default.nix @@ -1 +1,4 @@ -{ input-method-fcitx5-configuration = ./fcitx5-configuration.nix; } +{ + input-method-fcitx5-configuration = ./fcitx5-configuration.nix; + input-method-kime-configuration = ./kime-configuration.nix; +} diff --git a/tests/modules/i18n/input-method/kime-configuration.nix b/tests/modules/i18n/input-method/kime-configuration.nix new file mode 100644 index 00000000..fe50273f --- /dev/null +++ b/tests/modules/i18n/input-method/kime-configuration.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ + i18n.inputMethod = { + enabled = "kime"; + kime.config = { engine = { hangul = { layout = "dubeolsik"; }; }; }; + }; + + test.stubs.kime = { outPath = null; }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/kime-daemon.service + ''; +}