2022-02-10 16:55:03 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
let cfg = config.services.input-remapper; in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.input-remapper = {
|
2024-08-24 20:05:45 +00:00
|
|
|
enable = lib.mkEnableOption "input-remapper, an easy to use tool to change the mapping of your input device buttons";
|
|
|
|
package = lib.mkPackageOption pkgs "input-remapper" { };
|
|
|
|
enableUdevRules = lib.mkEnableOption "udev rules added by input-remapper to handle hotplugged devices. Currently disabled by default due to https://github.com/sezanzeb/input-remapper/issues/140";
|
|
|
|
serviceWantedBy = lib.mkOption {
|
2022-02-18 21:47:33 +00:00
|
|
|
default = [ "graphical.target" ];
|
|
|
|
example = [ "multi-user.target" ];
|
2024-08-24 20:05:45 +00:00
|
|
|
type = lib.types.listOf lib.types.str;
|
2022-02-18 21:47:33 +00:00
|
|
|
description = "Specifies the WantedBy setting for the input-remapper service.";
|
2022-02-10 16:55:03 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-24 20:05:45 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.udev.packages = lib.mkIf cfg.enableUdevRules [ cfg.package ];
|
2022-02-18 21:47:33 +00:00
|
|
|
services.dbus.packages = [ cfg.package ];
|
|
|
|
systemd.packages = [ cfg.package ];
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
2022-02-18 21:47:54 +00:00
|
|
|
systemd.services.input-remapper.wantedBy = cfg.serviceWantedBy;
|
2022-02-10 16:55:03 +00:00
|
|
|
};
|
2022-02-18 21:47:33 +00:00
|
|
|
|
|
|
|
meta.maintainers = with lib.maintainers; [ LunNova ];
|
2022-02-10 16:55:03 +00:00
|
|
|
}
|