narsil: bbc8fc5efd779ec885045f9b8d903d0df1bec1b2 -> f5ec6bd6b8013f2a2b74fc45b6f4c5374...
[NixPkgs.git] / pkgs / by-name / mo / mouse-actions / package.nix
blobfb95726bd65784e30b21ef2668f1f6661428129d
2   lib,
3   fetchFromGitHub,
4   rustPlatform,
5   pkg-config,
6   libX11,
7   libXi,
8   libXtst,
9   libevdev,
12 rustPlatform.buildRustPackage rec {
13   pname = "mouse-actions";
14   version = "0.4.5";
16   src = fetchFromGitHub {
17     owner = "jersou";
18     repo = "mouse-actions";
19     rev = "v${version}";
20     hash = "sha256-44F4CdsDHuN2FuijnpfmoFy4a/eAbYOoBYijl9mOctg=";
21   };
23   cargoHash = "sha256-N7BaEvQyKtM8hkDJJTlFKzfq01KMiGZ0fuXHcKctfLc=";
25   buildInputs = [
26     libX11
27     libXi
28     libXtst
29     libevdev
30   ];
32   nativeBuildInputs = [
33     pkg-config
34   ];
36   postInstall = ''
37     mkdir -p $out/etc/udev/rules.d/
38     echo 'KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' >> $out/etc/udev/rules.d/80-mouse-actions.rules
39     echo 'KERNEL=="/dev/input/event*", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"' >> $out/etc/udev/rules.d/80-mouse-actions.rules
40   '';
42   meta = with lib; {
43     description = "Execute commands from mouse events such as clicks/wheel on the side/corners of the screen, or drawing shapes";
44     homepage = "https://github.com/jersou/mouse-actions";
45     license = licenses.mit;
46     maintainers = with maintainers; [ rgri ];
47     mainProgram = "mouse-actions";
48     platforms = platforms.linux;
49   };