summary refs log tree commit diff
path: root/pkgs/tools/system/cm-rgb
diff options
context:
space:
mode:
authorDaniël de Kok <me@danieldk.eu>2020-07-10 09:08:48 +0200
committerDaniël de Kok <me@danieldk.eu>2020-07-21 11:43:34 +0200
commit031cc88afc4bff97d949747d486ffb1a1e7a25ca (patch)
treefb19b3f4e2130dae7638d379250ccebdc6554bb5 /pkgs/tools/system/cm-rgb
parent3dd18f05e55085c57d4df40fdfb9cbe9f92102f6 (diff)
downloadnixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.tar
nixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.tar.gz
nixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.tar.bz2
nixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.tar.lz
nixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.tar.xz
nixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.tar.zst
nixpkgs-031cc88afc4bff97d949747d486ffb1a1e7a25ca.zip
cm-rgb: init at 0.3.4
This is a set of utilities to control AMD Wraith Prism RGB LEDs.
Diffstat (limited to 'pkgs/tools/system/cm-rgb')
-rw-r--r--pkgs/tools/system/cm-rgb/default.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/tools/system/cm-rgb/default.nix b/pkgs/tools/system/cm-rgb/default.nix
new file mode 100644
index 00000000000..acfe440b5d5
--- /dev/null
+++ b/pkgs/tools/system/cm-rgb/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, buildPythonApplication
+, fetchFromGitHub
+, atk
+, gobject-introspection
+, wrapGAppsHook
+, click
+, hidapi
+, psutil
+, pygobject3
+}:
+
+buildPythonApplication rec {
+  pname = "cm-rgb";
+  version = "0.3.4";
+
+  src = fetchFromGitHub {
+    owner = "gfduszynski";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "04brldaa2zpvzkcg43i5hpbj03d1nqrgiplm5nh4shn12cif19ag";
+  };
+
+  nativeBuildInputs = [
+    atk
+
+    # Populate GI_TYPELIB_PATH
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  propagatedBuildInputs = [
+    click
+    hidapi
+    psutil
+    pygobject3
+  ];
+
+  postInstall = ''
+    # Remove this line when/if this PR gets merged:
+    # https://github.com/gfduszynski/cm-rgb/pull/43 
+    install -m0755 scripts/cm-rgb-gui $out/bin/cm-rgb-gui
+
+    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 stdenv.lib; {
+    description = "Control AMD Wraith Prism RGB LEDs";
+    longDescription = ''
+      cm-rgb controls AMD Wraith Prism RGB LEDS.
+
+      To permit non-root accounts to change 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; [ danieldk ];
+  };
+}