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