depot/third_party/nixpkgs/pkgs/misc/rivalcfg/default.nix
Default email 60f07311b9 Project import generated by Copybara.
GitOrigin-RevId: f8e2ebd66d097614d51a56a755450d4ae1632df1
2024-02-06 17:22:34 -08:00

41 lines
1.1 KiB
Nix

{ lib, fetchFromGitHub, python3Packages }:
python3Packages.buildPythonPackage rec {
pname = "rivalcfg";
version = "4.11.0";
src = fetchFromGitHub {
owner = "flozz";
repo = "rivalcfg";
rev = "refs/tags/v${version}";
sha256 = "sha256-6hgGb2BlXbnJ6uHbk8EUqrS/G1y65jTcw0zVCKt5+3k=";
};
propagatedBuildInputs = with python3Packages; [ hidapi setuptools ];
checkInputs = [ python3Packages.pytest ];
checkPhase = "pytest";
# tests are broken
doCheck = false;
postInstall = ''
set -x
mkdir -p $out/lib/udev/rules.d
tmpl_udev="$out/lib/udev/rules.d/99-rivalcfg.rules"
tmpudev="''${tmpl_udev}.in"
finaludev="$tmpl_udev"
"$out/bin/rivalcfg" --print-udev > "$tmpudev"
substitute "$tmpudev" "$out/lib/udev/rules.d/99-rivalcfg.rules" \
--replace MODE=\"0666\" "MODE=\"0664\", GROUP=\"input\""
rm "$tmpudev"
'';
meta = with lib; {
description = "Utility program that allows you to configure SteelSeries Rival gaming mice";
homepage = "https://github.com/flozz/rivalcfg";
license = licenses.wtfpl;
maintainers = with maintainers; [ ornxka ];
mainProgram = "rivalcfg";
};
}