Files
nixpkgs/nixos/modules/programs/mouse-actions.nix
whispers 14d99f9d24 mouse-actions-gui: drop
mouse-actions-gui is reliant on Tauri v1, which pulls in webkitgtk 4.0
and libsoup 2.4. The former has already been dropped, and the latter's
is imminent. It has been marked broken in Nixpkgs since October 2025.
2026-06-07 18:51:13 -04:00

45 lines
1.2 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.mouse-actions;
in
{
options.programs.mouse-actions = {
enable = lib.mkEnableOption "" // {
description = ''
Whether to install and set up mouse-actions and it's udev rules.
Note that only users in the "uinput" group will be able to use the package
'';
};
package = lib.mkPackageOption pkgs "mouse-actions" { };
autorun = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to start a user service to run mouse-actions on startup.
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
systemd.user.services.mouse-actions = lib.mkIf cfg.autorun {
description = "mouse-actions launcher";
wantedBy = [ "graphical-session.target" ];
bindsTo = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
environment.PATH = lib.mkForce null; # don't use the default PATH provided by NixOS
serviceConfig = {
ExecStart = "${lib.getExe cfg.package} start";
PassEnvironment = "PATH"; # inherit PATH from user environment
};
};
};
}