Merge pull request #146123 from thiagokokada/libinput-module-fixes

authored by

Sandro and committed by
GitHub
4f0e1c04 6456bfce

+55 -6
+10 -5
nixos/modules/services/x11/hardware/libinput.nix
··· 13 13 example = "/dev/input/event0"; 14 14 description = 15 15 '' 16 - Path for ${deviceType} device. Set to null to apply to any 16 + Path for ${deviceType} device. Set to <literal>null</literal> to apply to any 17 17 auto-detected ${deviceType}. 18 18 ''; 19 19 }; ··· 24 24 example = "flat"; 25 25 description = 26 26 '' 27 - Sets the pointer acceleration profile to the given profile. 28 - Permitted values are adaptive, flat. 27 + Sets the pointer acceleration profile to the given profile. 28 + Permitted values are <literal>adaptive</literal>, <literal>flat</literal>. 29 29 Not all devices support this option or all profiles. 30 30 If a profile is unsupported, the default profile for this is used. 31 31 <literal>flat</literal>: Pointer motion is accelerated by a constant ··· 38 38 accelSpeed = mkOption { 39 39 type = types.nullOr types.str; 40 40 default = null; 41 + example = "-0.5"; 41 42 description = "Cursor acceleration (how fast speed increases from minSpeed to maxSpeed)."; 42 43 }; 43 44 44 45 buttonMapping = mkOption { 45 46 type = types.nullOr types.str; 46 47 default = null; 48 + example = "1 6 3 4 5 0 7"; 47 49 description = 48 50 '' 49 51 Sets the logical button mapping for this device, see XSetPointerMapping(3). The string must ··· 58 60 calibrationMatrix = mkOption { 59 61 type = types.nullOr types.str; 60 62 default = null; 63 + example = "0.5 0 0 0 0.8 0.1 0 0 1"; 61 64 description = 62 65 '' 63 - A string of 9 space-separated floating point numbers. Sets the calibration matrix to the 66 + A string of 9 space-separated floating point numbers. Sets the calibration matrix to the 64 67 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). 65 68 ''; 66 69 }; ··· 68 71 clickMethod = mkOption { 69 72 type = types.nullOr (types.enum [ "none" "buttonareas" "clickfinger" ]); 70 73 default = null; 74 + example = "buttonareas"; 71 75 description = 72 76 '' 73 77 Enables a click method. Permitted values are <literal>none</literal>, ··· 166 170 transformationMatrix = mkOption { 167 171 type = types.nullOr types.str; 168 172 default = null; 173 + example = "0.5 0 0 0 0.8 0.1 0 0 1"; 169 174 description = '' 170 - A string of 9 space-separated floating point numbers. Sets the transformation matrix to 175 + A string of 9 space-separated floating point numbers. Sets the transformation matrix to 171 176 the 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). 172 177 ''; 173 178 };
+2 -1
nixos/tests/all-tests.nix
··· 228 228 kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {}; 229 229 latestKernel.login = handleTest ./login.nix { latestKernel = true; }; 230 230 leaps = handleTest ./leaps.nix {}; 231 + libinput = handleTest ./libinput.nix {}; 231 232 libreddit = handleTest ./libreddit.nix {}; 233 + libreswan = handleTest ./libreswan.nix {}; 232 234 lidarr = handleTest ./lidarr.nix {}; 233 - libreswan = handleTest ./libreswan.nix {}; 234 235 lightdm = handleTest ./lightdm.nix {}; 235 236 limesurvey = handleTest ./limesurvey.nix {}; 236 237 litestream = handleTest ./litestream.nix {};
+38
nixos/tests/libinput.nix
··· 1 + import ./make-test-python.nix ({ ... }: 2 + 3 + { 4 + name = "libinput"; 5 + 6 + machine = { ... }: 7 + { 8 + imports = [ 9 + ./common/x11.nix 10 + ./common/user-account.nix 11 + ]; 12 + 13 + test-support.displayManager.auto.user = "alice"; 14 + 15 + services.xserver.libinput = { 16 + enable = true; 17 + mouse = { 18 + naturalScrolling = true; 19 + leftHanded = true; 20 + middleEmulation = false; 21 + horizontalScrolling = false; 22 + }; 23 + }; 24 + }; 25 + 26 + testScript = '' 27 + def expect_xserver_option(option, value): 28 + machine.succeed(f"""cat /var/log/X.0.log | grep -F 'Option "{option}" "{value}"'""") 29 + 30 + machine.start() 31 + machine.wait_for_x() 32 + machine.succeed("""cat /var/log/X.0.log | grep -F "Using input driver 'libinput'" """) 33 + expect_xserver_option("NaturalScrolling", "on") 34 + expect_xserver_option("LeftHanded", "on") 35 + expect_xserver_option("MiddleEmulation", "off") 36 + expect_xserver_option("HorizontalScrolling", "off") 37 + ''; 38 + })
+5
pkgs/development/libraries/libinput/default.nix
··· 3 3 , documentationSupport ? false, doxygen, graphviz # Documentation 4 4 , eventGUISupport ? false, cairo, glib, gtk3 # GUI event viewer support 5 5 , testsSupport ? false, check, valgrind, python3 6 + , nixosTests 6 7 }: 7 8 8 9 let ··· 75 76 ''; 76 77 77 78 doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform; 79 + 80 + passthru.tests = { 81 + libinput-module = nixosTests.libinput; 82 + }; 78 83 79 84 meta = with lib; { 80 85 description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";