2022-02-10 16:55:03 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let cfg = config.services.input-remapper; in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.input-remapper = {
|
2023-02-01 05:12:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "input-remapper, an easy to use tool to change the mapping of your input device buttons");
|
2022-12-30 20:04:52 +00:00
|
|
|
package = mkPackageOptionMD pkgs "input-remapper" { };
|
2022-08-28 20:18:44 +01:00
|
|
|
enableUdevRules = mkEnableOption (lib.mdDoc "udev rules added by input-remapper to handle hotplugged devices. Currently disabled by default due to https://github.com/sezanzeb/input-remapper/issues/140");
|
2022-02-18 21:47:33 +00:00
|
|
|
serviceWantedBy = mkOption {
|
|
|
|
default = [ "graphical.target" ];
|
|
|
|
example = [ "multi-user.target" ];
|
|
|
|
type = types.listOf types.str;
|
2022-07-28 22:19:15 +01:00
|
|
|
description = lib.mdDoc "Specifies the WantedBy setting for the input-remapper service.";
|
2022-02-10 16:55:03 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-02-18 21:47:33 +00:00
|
|
|
services.udev.packages = mkIf cfg.enableUdevRules [ cfg.package ];
|
|
|
|
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
|
|
|
}
|