about summary refs log tree commit diff
path: root/pkgs/tools/system/cm-rgb/default.nix
blob: adc291d4f85d519a68e4b7b52f62ec7e189d0ae4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, buildPythonApplication
, fetchFromGitHub
, atk
, gobject-introspection
, wrapGAppsHook
, click
, hidapi
, psutil
, pygobject3
}:

buildPythonApplication rec {
  pname = "cm-rgb";
  version = "0.3.6";

  src = fetchFromGitHub {
    owner = "gfduszynski";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-m0ZAjSLRzcjzygLEbvCiDd7krc1gRqTg1ZV4H/o2c68=";
  };

  nativeBuildInputs = [
    atk

    # Populate GI_TYPELIB_PATH
    gobject-introspection
    wrapGAppsHook
  ];

  propagatedBuildInputs = [
    click
    hidapi
    psutil
    pygobject3
  ];

  postInstall = ''
    mkdir -p $out/etc/udev/rules.d
    echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", TAG+="uaccess"' \
      > $out/etc/udev/rules.d/60-cm-rgb.rules
  '';

  meta = with lib; {
    description = "Control AMD Wraith Prism RGB LEDs";
    longDescription = ''
      cm-rgb controls AMD Wraith Prism RGB LEDS.

      To permit non-root accounts to use this utility on
      NixOS, add this package to <literal>services.udev.packages</literal>
      in <filename>configuration.nix</filename>.
    '';
    homepage = "https://github.com/gfduszynski/cm-rgb";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ ];
  };
}