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