nixpkgs/nixos/tests/libinput.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
985 B
Nix
Raw Normal View History

2021-11-15 11:46:20 +00:00
import ./make-test-python.nix ({ ... }:
{
name = "libinput";
2022-03-20 23:15:30 +00:00
nodes.machine = { ... }:
2021-11-15 11:46:20 +00:00
{
imports = [
./common/x11.nix
./common/user-account.nix
];
test-support.displayManager.auto.user = "alice";
services.libinput = {
2021-11-15 11:46:20 +00:00
enable = true;
mouse = {
naturalScrolling = true;
leftHanded = true;
middleEmulation = false;
horizontalScrolling = false;
};
};
};
testScript = ''
def expect_xserver_option(option, value):
machine.succeed(f"""cat /var/log/X.0.log | grep -F 'Option "{option}" "{value}"'""")
machine.start()
machine.wait_for_x()
machine.succeed("""cat /var/log/X.0.log | grep -F "Using input driver 'libinput'" """)
expect_xserver_option("NaturalScrolling", "on")
expect_xserver_option("LeftHanded", "on")
expect_xserver_option("MiddleEmulation", "off")
expect_xserver_option("HorizontalScrolling", "off")
'';
})