#
# Alienware x14 (r2) light controller.
#
# vim: et:ts=2:sw=2:
{
  lib,
  libusb1,
  stdenv,
  ...
}:
stdenv.mkDerivation rec {
  pname = "humanfx";
  version = "3024-03-24";

  src = ./src;

  buildInputs = [
    libusb1
  ];

  buildPhase = ''
    gcc -Wall -Wextra -o ${pname} main.c ${pname}.c -lusb-1.0 -I${libusb1.dev}/include -L${libusb1}/lib
  '';

  installPhase = ''
    install -D ${pname} $out/bin/ledctl
    install -D $src/60-alienware-elc.rules $out/lib/udev/rules.d/60-alienware-elc.rules
  '';

}
