From 8810c25b5a2a3786807ed25fc141a9c8f9940459 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Mon, 25 Apr 2022 16:57:00 -0400 Subject: [PATCH] Enable input-remapper --- modules/services/input-remapper.nix | 32 +++++++++++++++++++++++++++++ nki-x1c1/configuration.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 modules/services/input-remapper.nix diff --git a/modules/services/input-remapper.nix b/modules/services/input-remapper.nix new file mode 100644 index 0000000..e550aa9 --- /dev/null +++ b/modules/services/input-remapper.nix @@ -0,0 +1,32 @@ +# This is a stub, until 22.05 merge this +{ 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.unstable.input-remapper; + }; + enableUdevRules = 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 = mkOption { + default = [ "graphical.target" ]; + example = [ "multi-user.target" ]; + type = types.listOf types.str; + description = "Specifies the WantedBy setting for the input-remapper service."; + }; + }; + }; + + config = mkIf cfg.enable { + services.udev.packages = 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; + }; +} diff --git a/nki-x1c1/configuration.nix b/nki-x1c1/configuration.nix index 8d1e18e..566cf55 100644 --- a/nki-x1c1/configuration.nix +++ b/nki-x1c1/configuration.nix @@ -13,6 +13,7 @@ ../modules/personal/fonts # Some PAM stuff ../modules/services/pam/gnome-keyring.nix + ../modules/services/input-remapper.nix ]; # Use the latest kernel boot.kernelPackages = pkgs.linuxPackages_latest; @@ -145,6 +146,7 @@ # List services that you want to enable: nki.services.pam.enableGnomeKeyring = true; + services.input-remapper.enable = true; # Enable the OpenSSH daemon. services.openssh.enable = true;