summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-08-15 08:36:07 +0800
committerNick Cao <nickcao@nichi.co>2023-08-15 08:36:07 +0800
commitfecb8c7752d3f88eb5d83a0b0f24dccb09c8d897 (patch)
treef09ac0640d641d72de583b6515980a4104978e0e /nixos
parenteb2b0b09b37422ce4dcff464df6488131b12998a (diff)
downloadnixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.tar
nixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.tar.gz
nixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.tar.bz2
nixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.tar.lz
nixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.tar.xz
nixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.tar.zst
nixpkgs-fecb8c7752d3f88eb5d83a0b0f24dccb09c8d897.zip
nixosTests.fcitx5: make use of the newly added settings option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/fcitx5/config11
-rw-r--r--nixos/tests/fcitx5/default.nix47
-rw-r--r--nixos/tests/fcitx5/profile27
3 files changed, 37 insertions, 48 deletions
diff --git a/nixos/tests/fcitx5/config b/nixos/tests/fcitx5/config
deleted file mode 100644
index cf4334639f1..00000000000
--- a/nixos/tests/fcitx5/config
+++ /dev/null
@@ -1,11 +0,0 @@
-[Hotkey]
-EnumerateSkipFirst=False
-
-[Hotkey/TriggerKeys]
-0=Control+space
-
-[Hotkey/EnumerateForwardKeys]
-0=Alt+Shift_L
-
-[Hotkey/EnumerateBackwardKeys]
-0=Alt+Shift_R
diff --git a/nixos/tests/fcitx5/default.nix b/nixos/tests/fcitx5/default.nix
index 9b000da48ea..c113f2e2c05 100644
--- a/nixos/tests/fcitx5/default.nix
+++ b/nixos/tests/fcitx5/default.nix
@@ -36,6 +36,43 @@ rec {
         pkgs.fcitx5-m17n
         pkgs.fcitx5-mozc
       ];
+      fcitx5.settings = {
+        globalOptions = {
+          "Hotkey"."EnumerateSkipFirst" = "False";
+          "Hotkey/TriggerKeys"."0" = "Control+space";
+          "Hotkey/EnumerateForwardKeys"."0" = "Alt+Shift_L";
+          "Hotkey/EnumerateBackwardKeys"."0" = "Alt+Shift_R";
+        };
+        inputMethod = {
+          "GroupOrder" = {
+            "0" = "NixOS_test";
+          };
+          "Groups/0" = {
+            "Default Layout" = "us";
+            "DefaultIM" = "wbx";
+            "Name" = "NixOS_test";
+          };
+          "Groups/0/Items/0" = {
+            "Name" = "keyboard-us";
+          };
+          "Groups/0/Items/1" = {
+            "Layout" = "us";
+            "Name" = "wbx";
+          };
+          "Groups/0/Items/2" = {
+            "Layout" = "us";
+            "Name" = "hangul";
+          };
+          "Groups/0/Items/3" = {
+            "Layout" = "us";
+            "Name" = "m17n_sa_harvard-kyoto";
+          };
+          "Groups/0/Items/4" = {
+            "Layout" = "us";
+            "Name" = "mozc";
+          };
+        };
+      };
     };
   };
 
@@ -43,7 +80,6 @@ rec {
     let
       user = nodes.machine.users.users.alice;
       xauth         = "${user.home}/.Xauthority";
-      fcitx_confdir = "${user.home}/.config/fcitx5";
     in
       ''
             start_all()
@@ -56,15 +92,6 @@ rec {
             machine.succeed("su - ${user.name} -c 'kill $(pgrep fcitx5)'")
             machine.sleep(1)
 
-            machine.copy_from_host(
-                "${./profile}",
-                "${fcitx_confdir}/profile",
-            )
-            machine.copy_from_host(
-                "${./config}",
-                "${fcitx_confdir}/config",
-            )
-
             machine.succeed("su - ${user.name} -c 'alacritty >&2 &'")
             machine.succeed("su - ${user.name} -c 'fcitx5 >&2 &'")
             machine.sleep(10)
diff --git a/nixos/tests/fcitx5/profile b/nixos/tests/fcitx5/profile
deleted file mode 100644
index 1b48c634e0e..00000000000
--- a/nixos/tests/fcitx5/profile
+++ /dev/null
@@ -1,27 +0,0 @@
-[Groups/0]
-Name=NixOS_test
-Default Layout=us
-DefaultIM=wbx
-
-[Groups/0/Items/0]
-Name=keyboard-us
-Layout=
-
-[Groups/0/Items/1]
-Name=wbx
-Layout=us
-
-[Groups/0/Items/2]
-Name=hangul
-Layout=us
-
-[Groups/0/Items/3]
-Name=m17n_sa_harvard-kyoto
-Layout=us
-
-[Groups/0/Items/4]
-Name=mozc
-Layout=us
-
-[GroupOrder]
-0=NixOS_test