depot/nixos/modules/services/misc/input-remapper.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

27 lines
1.1 KiB
Nix

{ pkgs, lib, config, ... }:
let cfg = config.services.input-remapper; in
{
options = {
services.input-remapper = {
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 {
default = [ "graphical.target" ];
example = [ "multi-user.target" ];
type = lib.types.listOf lib.types.str;
description = "Specifies the WantedBy setting for the input-remapper service.";
};
};
};
config = lib.mkIf cfg.enable {
services.udev.packages = lib.mkIf cfg.enableUdevRules [ cfg.package ];
services.dbus.packages = [ cfg.package ];
systemd.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
systemd.services.input-remapper.wantedBy = cfg.serviceWantedBy;
};
meta.maintainers = with lib.maintainers; [ LunNova ];
}