diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 13e3a49496f0..16f686115750 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -20519,6 +20519,12 @@ githubId = 18403034; name = "Shaddy"; }; + shadowapex = { + email = "shadowapex@gmail.com"; + github = "ShadowApex"; + githubId = 376460; + name = "William Edwards"; + }; shadowrz = { email = "shadowrz+nixpkgs@disroot.org"; matrix = "@shadowrz:nixos.dev"; diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 948f097395fe..06f96ab91bd6 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -50,6 +50,8 @@ - [nvidia-gpu](https://github.com/utkuozdemir/nvidia_gpu_exporter), a Prometheus exporter that scrapes `nvidia-smi` for GPU metrics. Available as [services.prometheus.exporters.nvidia-gpu](#opt-services.prometheus.exporters.nvidia-gpu.enable). +- [InputPlumber](https://github.com/ShadowBlip/InputPlumber/), an open source input router and remapper daemon for Linux. Available as [services.inputplumber](#opt-services.inputplumber.enable). + - [Buffyboard](https://gitlab.postmarketos.org/postmarketOS/buffybox/-/tree/master/buffyboard), a framebuffer on-screen keyboard. Available as [services.buffyboard](option.html#opt-services.buffyboard). - [KanBoard](https://github.com/kanboard/kanboard), a project management tool that focuses on the Kanban methodology. Available as [services.kanboard](#opt-services.kanboard.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 783f20546af4..b0be0d159fd9 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -604,6 +604,7 @@ ./services/hardware/handheld-daemon.nix ./services/hardware/hddfancontrol.nix ./services/hardware/illum.nix + ./services/hardware/inputplumber.nix ./services/hardware/interception-tools.nix ./services/hardware/iptsd.nix ./services/hardware/irqbalance.nix diff --git a/nixos/modules/services/hardware/inputplumber.nix b/nixos/modules/services/hardware/inputplumber.nix new file mode 100644 index 000000000000..ebefa3263961 --- /dev/null +++ b/nixos/modules/services/hardware/inputplumber.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.services.inputplumber; +in +{ + options.services.inputplumber = { + enable = lib.mkEnableOption "InputPlumber"; + package = lib.mkPackageOption pkgs "inputplumber" { }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [ cfg.package ]; + + systemd.services.inputplumber = { + description = "InputPlumber Service"; + wantedBy = [ "multi-user.target" ]; + environment = { + XDG_DATA_DIRS = "/run/current-system/sw/share"; + }; + restartIfChanged = true; + + serviceConfig = { + ExecStart = "${lib.getExe cfg.package}"; + Restart = "on-failure"; + RestartSec = "5"; + }; + }; + }; + + meta.maintainers = with lib.maintainers; [ shadowapex ]; +} diff --git a/pkgs/by-name/in/inputplumber/package.nix b/pkgs/by-name/in/inputplumber/package.nix new file mode 100644 index 000000000000..dbaacd37d51d --- /dev/null +++ b/pkgs/by-name/in/inputplumber/package.nix @@ -0,0 +1,48 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + udev, + libiio, + libevdev, +}: + +rustPlatform.buildRustPackage rec { + pname = "inputplumber"; + version = "0.39.2"; + + src = fetchFromGitHub { + owner = "ShadowBlip"; + repo = "InputPlumber"; + rev = "refs/tags/v${version}"; + hash = "sha256-Glq7iJ1AHy99AGXYg5P3wAd3kAMJnt5P2vZzyn7qBY4="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-pcbW/Od5f+hFCrVpH2yioq+qCmlZ1m3TbUc6rBkYCEs="; + + nativeBuildInputs = [ + pkg-config + rustPlatform.bindgenHook + ]; + + buildInputs = [ + udev + libevdev + libiio + ]; + + postInstall = '' + cp -r rootfs/usr/* $out/ + ''; + + meta = { + description = "Open source input router and remapper daemon for Linux"; + homepage = "https://github.com/ShadowBlip/InputPlumber"; + license = lib.licenses.gpl3Plus; + changelog = "https://github.com/ShadowBlip/InputPlumber/releases/tag/v${version}"; + maintainers = with lib.maintainers; [ shadowapex ]; + mainProgram = "inputplumber"; + }; +}