1{
2 pkgs,
3 lib,
4 config,
5 ...
6}:
7let
8 cfg = config.services.input-remapper;
9in
10{
11 options = {
12 services.input-remapper = {
13 enable = lib.mkEnableOption "input-remapper, an easy to use tool to change the mapping of your input device buttons";
14 package = lib.mkPackageOption pkgs "input-remapper" { };
15 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>";
16 serviceWantedBy = lib.mkOption {
17 default = [ "graphical.target" ];
18 example = [ "multi-user.target" ];
19 type = lib.types.listOf lib.types.str;
20 description = "Specifies the WantedBy setting for the input-remapper service.";
21 };
22 };
23 };
24
25 config = lib.mkIf cfg.enable {
26 services.udev.packages = lib.mkIf cfg.enableUdevRules [ cfg.package ];
27 services.dbus.packages = [ cfg.package ];
28 systemd.packages = [ cfg.package ];
29 environment.systemPackages = [ cfg.package ];
30 systemd.services.input-remapper.wantedBy = cfg.serviceWantedBy;
31 };
32
33 meta.maintainers = with lib.maintainers; [ LunNova ];
34}