Skip to content

Commit

Permalink
cm-rgb: init at 0.3.4
Browse files Browse the repository at this point in the history
This is a set of utilities to control AMD Wraith Prism RGB LEDs.
  • Loading branch information
danieldk committed Jul 21, 2020
1 parent 3dd18f0 commit 031cc88
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
63 changes: 63 additions & 0 deletions pkgs/tools/system/cm-rgb/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16752,6 +16752,8 @@ in

cifs-utils = callPackage ../os-specific/linux/cifs-utils { };

cm-rgb = python3Packages.callPackage ../tools/system/cm-rgb { };

cpustat = callPackage ../os-specific/linux/cpustat { };

cockroachdb = callPackage ../servers/sql/cockroachdb { };
Expand Down

0 comments on commit 031cc88

Please sign in to comment.