1 import ./make-test-python.nix ({ pkgs, ... }:
4 name = "input-remapper";
6 maintainers = with pkgs.lib.maintainers; [ LunNova ];
9 nodes.machine = { config, ... }:
10 let user = config.users.users.sybil; in
13 ./common/user-account.nix
17 services.xserver.enable = true;
18 services.input-remapper.enable = true;
19 users.users.sybil = { isNormalUser = true; group = "wheel"; };
20 test-support.displayManager.auto.user = user.name;
21 # workaround for pkexec not working in the test environment
22 # Error creating textual authentication agent:
23 # Error opening current controlling terminal for the process (`/dev/tty'):
24 # No such device or address
25 # passwordless pkexec with polkit module also doesn't work
26 # to allow the program to run, we replace pkexec with sudo
27 # and turn on passwordless sudo
28 # this is not correct in general but good enough for this test
29 security.sudo = { enable = true; wheelNeedsPassword = false; };
30 security.wrappers.pkexec = pkgs.lib.mkForce
35 source = "${pkgs.sudo}/bin/sudo";
41 testScript = { nodes, ... }: ''
45 machine.succeed("systemctl status input-remapper.service")
46 machine.execute("su - sybil -c input-remapper-gtk >&2 &")
48 machine.wait_for_text("Input Remapper")
49 machine.wait_for_text("Device")
50 machine.wait_for_text("Presets")
51 machine.wait_for_text("Editor")