mouse-actions-gui: init at 0.4.4 (#269518)

authored by Artturin and committed by GitHub 74065337 7550a646

+132 -7
+33 -7
nixos/modules/programs/mouse-actions.nix
··· 3 3 let 4 4 cfg = config.programs.mouse-actions; 5 5 in 6 - { 7 - options.programs.mouse-actions = { 8 - enable = lib.mkEnableOption '' 9 - mouse-actions udev rules. This is a prerequisite for using mouse-actions without being root 6 + { 7 + options.programs.mouse-actions = { 8 + enable = lib.mkEnableOption "" // { 9 + description = '' 10 + Whether to install and set up mouse-actions and it's udev rules. 11 + 12 + Note that only users in the "uinput" group will be able to use the package 10 13 ''; 11 14 }; 12 - config = lib.mkIf cfg.enable { 13 - services.udev.packages = [ pkgs.mouse-actions ]; 15 + package = lib.mkPackageOption pkgs "mouse-actions" { 16 + example = "mouse-actions-gui"; 14 17 }; 15 - } 18 + autorun = lib.mkOption { 19 + type = lib.types.bool; 20 + default = false; 21 + description = '' 22 + Whether to start a user service to run mouse-actions on startup. 23 + ''; 24 + }; 25 + }; 26 + config = lib.mkIf cfg.enable { 27 + environment.systemPackages = [ cfg.package ]; 28 + services.udev.packages = [ cfg.package ]; 29 + systemd.user.services.mouse-actions = lib.mkIf cfg.autorun { 30 + description = "mouse-actions launcher"; 31 + wantedBy = [ "graphical-session.target" ]; 32 + bindsTo = [ "graphical-session.target" ]; 33 + after = [ "graphical-session.target" ]; 34 + environment.PATH = lib.mkForce null; # don't use the default PATH provided by NixOS 35 + serviceConfig = { 36 + ExecStart = "${lib.getExe cfg.package} start"; 37 + PassEnvironment = "PATH"; # inherit PATH from user environment 38 + }; 39 + }; 40 + }; 41 + }
+2
pkgs/by-name/mo/mouse-actions-gui/80-mouse-actions.rules
··· 1 + KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput" 2 + KERNEL=="/dev/input/event*", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"
+97
pkgs/by-name/mo/mouse-actions-gui/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + 6 + npmHooks, 7 + fetchNpmDeps, 8 + nodejs, 9 + 10 + rustPlatform, 11 + cargo, 12 + rustc, 13 + cargo-tauri, 14 + 15 + pkg-config, 16 + wrapGAppsHook3, 17 + libXtst, 18 + libevdev, 19 + gtk3, 20 + libsoup, 21 + webkitgtk, 22 + }: 23 + 24 + stdenv.mkDerivation (finalAttrs: { 25 + pname = "mouse-actions-gui"; 26 + version = "0.4.4"; 27 + 28 + src = fetchFromGitHub { 29 + owner = "jersou"; 30 + repo = "mouse-actions"; 31 + rev = "v${finalAttrs.version}"; 32 + hash = "sha256-02E4HrKIoBV3qZPVH6Tjz9Bv/mh5C8amO1Ilmd+YO5g="; 33 + }; 34 + 35 + sourceRoot = "${finalAttrs.src.name}/config-editor"; 36 + 37 + nativeBuildInputs = [ 38 + npmHooks.npmConfigHook 39 + nodejs 40 + rustPlatform.cargoSetupHook 41 + cargo 42 + rustc 43 + cargo-tauri 44 + pkg-config 45 + wrapGAppsHook3 46 + ]; 47 + 48 + buildInputs = [ 49 + # Base deps 50 + libXtst 51 + libevdev 52 + 53 + # Tauri deps 54 + gtk3 55 + libsoup 56 + webkitgtk 57 + ]; 58 + 59 + npmDeps = fetchNpmDeps { 60 + inherit (finalAttrs) src sourceRoot; 61 + hash = "sha256-Rnr5jRupdUu6mIsWvdN6AnQnsxB5h31n/24pYslGs5g="; 62 + }; 63 + 64 + cargoRoot = "src-tauri"; 65 + 66 + cargoDeps = rustPlatform.fetchCargoTarball { 67 + name = "${finalAttrs.pname}-${finalAttrs.version}"; 68 + inherit (finalAttrs) src; 69 + sourceRoot = "${finalAttrs.sourceRoot}/${finalAttrs.cargoRoot}"; 70 + hash = "sha256-VQFRatnxzmywAiMLfkVgB7g8AFoqfWFYjt/vezpE1o8="; 71 + }; 72 + 73 + buildPhase = '' 74 + runHook preBuild 75 + cargo-tauri build -b deb 76 + runHook postBuild 77 + ''; 78 + 79 + installPhase = '' 80 + runHook preInstall 81 + 82 + install -Dm644 ${./80-mouse-actions.rules} $out/etc/udev/rules.d/80-mouse-actions.rules 83 + cp -r src-tauri/target/release/bundle/deb/*/data/usr/* $out 84 + 85 + runHook postInstall 86 + ''; 87 + 88 + meta = { 89 + changelog = "https://github.com/jersou/mouse-actions/blob/${finalAttrs.src.rev}/CHANGELOG.md"; 90 + description = "Mouse event based command executor, a mix between Easystroke and Comiz edge commands"; 91 + homepage = "https://github.com/jersou/mouse-actions"; 92 + license = lib.licenses.mit; 93 + mainProgram = "mouse-actions-gui"; 94 + maintainers = with lib.maintainers; [ tomasajt ]; 95 + platforms = lib.platforms.linux; 96 + }; 97 + })