Files
nixpkgs/nixos/modules/programs/mouse-actions.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

47 lines
1.3 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" {
example = "mouse-actions-gui";
};
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
};
};
};
}