From bcab2a1246c53d95270601068378d2e5f2eb379c Mon Sep 17 00:00:00 2001 From: Torben Schweren Date: Sat, 27 Apr 2024 20:22:07 +0200 Subject: [PATCH] inputmodule-control: init at v0.2.0 Packaged this as it was still missing from nixpkgs and to further support NixOS on Framework laptops. Repo: https://github.com/FrameworkComputer/inputmodule-rs Release: https://github.com/FrameworkComputer/inputmodule-rs/releases/tag/v0.2.0 --- .../in/inputmodule-control/package.nix | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pkgs/by-name/in/inputmodule-control/package.nix diff --git a/pkgs/by-name/in/inputmodule-control/package.nix b/pkgs/by-name/in/inputmodule-control/package.nix new file mode 100644 index 000000000000..0133a868ad8b --- /dev/null +++ b/pkgs/by-name/in/inputmodule-control/package.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + testers, + rustPlatform, + fetchFromGitHub, + inputmodule-control, + pkg-config, + libudev-zero, +}: + +rustPlatform.buildRustPackage rec { + pname = "inputmodule-control"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "FrameworkComputer"; + repo = "inputmodule-rs"; + rev = "v${version}"; + hash = "sha256-5sqTkaGqmKDDH7byDZ84rzB3FTu9AKsWxA6EIvUrLCU="; + }; + + useFetchCargoVendor = true; + cargoHash = "sha256-s5k23p0Fo+DQvGpDvy/VmGNFK7ZysqLIyDPuUn6n724="; + + buildAndTestSubdir = "inputmodule-control"; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ libudev-zero ]; + + postInstall = '' + install -Dm644 release/50-framework-inputmodule.rules $out/etc/udev/rules.d/50-framework-inputmodule.rules + ''; + + passthru.tests.version = testers.testVersion { + package = inputmodule-control; + }; + + meta = { + description = "CLI tool to control Framework input modules like the LED matrix"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + mainProgram = "inputmodule-control"; + homepage = "https://github.com/FrameworkComputer/inputmodule-rs"; + downloadPage = "https://github.com/FrameworkComputer/inputmodule-rs/releases/tag/${src.rev}"; + changelog = "https://github.com/FrameworkComputer/inputmodule-rs/releases/tag/${src.rev}"; + maintainers = with lib.maintainers; [ Kitt3120 ]; + }; +}