1{
2 lib,
3 buildPythonApplication,
4 fetchFromGitHub,
5 atk,
6 gobject-introspection,
7 wrapGAppsHook3,
8 click,
9 hidapi,
10 psutil,
11 pygobject3,
12 udevCheckHook,
13 stdenv,
14}:
15
16buildPythonApplication rec {
17 pname = "cm-rgb";
18 version = "0.3.6";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "gfduszynski";
23 repo = pname;
24 rev = "v${version}";
25 sha256 = "sha256-m0ZAjSLRzcjzygLEbvCiDd7krc1gRqTg1ZV4H/o2c68=";
26 };
27
28 nativeBuildInputs = [
29 atk
30
31 # Populate GI_TYPELIB_PATH
32 gobject-introspection
33 wrapGAppsHook3
34 udevCheckHook
35 ];
36
37 propagatedBuildInputs = [
38 click
39 hidapi
40 psutil
41 pygobject3
42 ];
43
44 postInstall = ''
45 mkdir -p $out/etc/udev/rules.d
46 echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", TAG+="uaccess"' \
47 > $out/etc/udev/rules.d/60-cm-rgb.rules
48 '';
49
50 meta = with lib; {
51 description = "Control AMD Wraith Prism RGB LEDs";
52 longDescription = ''
53 cm-rgb controls AMD Wraith Prism RGB LEDS.
54
55 To permit non-root accounts to use this utility on
56 NixOS, add this package to <literal>services.udev.packages</literal>
57 in <filename>configuration.nix</filename>.
58 '';
59 homepage = "https://github.com/gfduszynski/cm-rgb";
60 license = licenses.mit;
61 platforms = platforms.all;
62 maintainers = [ ];
63 };
64}