1{ ... }:
2
3{
4 name = "libinput";
5
6 nodes.machine =
7 { ... }:
8 {
9 imports = [
10 ./common/x11.nix
11 ./common/user-account.nix
12 ];
13
14 test-support.displayManager.auto.user = "alice";
15
16 services.libinput = {
17 enable = true;
18 mouse = {
19 naturalScrolling = true;
20 leftHanded = true;
21 middleEmulation = false;
22 horizontalScrolling = false;
23 };
24 };
25 };
26
27 testScript = ''
28 def expect_xserver_option(option, value):
29 machine.succeed(f"""cat /var/log/X.0.log | grep -F 'Option "{option}" "{value}"'""")
30
31 machine.start()
32 machine.wait_for_x()
33 machine.succeed("""cat /var/log/X.0.log | grep -F "Using input driver 'libinput'" """)
34 expect_xserver_option("NaturalScrolling", "on")
35 expect_xserver_option("LeftHanded", "on")
36 expect_xserver_option("MiddleEmulation", "off")
37 expect_xserver_option("HorizontalScrolling", "off")
38 '';
39}