From 93d8783ad6fa49f7024568e9785074d2fc5ffc35 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Thu, 10 Feb 2022 08:55:03 -0800 Subject: [PATCH] nixos/input-remapper: init --- nixos/modules/module-list.nix | 1 + .../modules/services/misc/input-remapper.nix | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 nixos/modules/services/misc/input-remapper.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 70964ad80f73..36ca06261784 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -547,6 +547,7 @@ ./services/misc/greenclip.nix ./services/misc/home-assistant.nix ./services/misc/ihaskell.nix + ./services/misc/input-remapper.nix ./services/misc/irkerd.nix ./services/misc/jackett.nix ./services/misc/jellyfin.nix diff --git a/nixos/modules/services/misc/input-remapper.nix b/nixos/modules/services/misc/input-remapper.nix new file mode 100644 index 000000000000..c2da0d616a31 --- /dev/null +++ b/nixos/modules/services/misc/input-remapper.nix @@ -0,0 +1,29 @@ +{ pkgs, lib, config, ... }: + +with lib; + +let cfg = config.services.input-remapper; in +{ + options = { + services.input-remapper = { + enable = mkEnableOption "input-remapper, an easy to use tool to change the mapping of your input device buttons."; + package = mkOption { + type = types.package; + default = pkgs.input-remapper; + defaultText = literalExpression "pkgs.input-remapper"; + description = '' + The input-remapper package to use. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + # FIXME: udev rule hangs sometimes when lots of devices connected, so let's not use it + # config.services.udev.packages = mapper-pkg; + services.dbus.packages = cfg.package; + systemd.packages = cfg.package; + environment.systemPackages = cfg.package; + systemd.services.input-remapper.wantedBy = [ "graphical.target" ]; + }; +}