summaryrefslogtreecommitdiffstats
path: root/pkgs/os-specific/linux/brillo
diff options
context:
space:
mode:
authorAlex Rice <alexrice999@hotmail.co.uk>2019-04-14 10:53:43 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-11-03 14:42:43 +0100
commit66611546f0a57a4d8c7a36af07ad0105f8942d5d (patch)
tree805c9b290c59a54f23e1805d0b467736225246fd /pkgs/os-specific/linux/brillo
parent6928b5c12b217ccf0b6cd3da679ec88986640293 (diff)
brillo: init at 1.4.8
Diffstat (limited to 'pkgs/os-specific/linux/brillo')
-rw-r--r--pkgs/os-specific/linux/brillo/default.nix34
-rw-r--r--pkgs/os-specific/linux/brillo/udev-rule.patch13
2 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/brillo/default.nix b/pkgs/os-specific/linux/brillo/default.nix
new file mode 100644
index 000000000000..3ad4acf127b7
--- /dev/null
+++ b/pkgs/os-specific/linux/brillo/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitLab , go-md2man, coreutils, substituteAll }:
+
+stdenv.mkDerivation rec {
+ pname = "brillo";
+ version = "1.4.8";
+
+ src = fetchFromGitLab {
+ owner= "cameronnemo";
+ repo= "brillo";
+ rev= "v${version}";
+ sha256 = "0wxvg541caiwm3bjwbmk7xcng7jd9xsiga2agxwp7gpkrlp74j9f";
+ };
+
+ patches = [
+ (substituteAll {
+ src = ./udev-rule.patch;
+ inherit coreutils;
+ })
+ ];
+
+ nativeBuildInputs = [ go-md2man ];
+
+ makeFlags = [ "PREFIX=$(out)" "AADIR=$(out)/etc/apparmor.d" ];
+
+ installTargets = "install-dist";
+
+ meta = with stdenv.lib; {
+ description = "Backlight and Keyboard LED control tool";
+ homepage = https://gitlab.com/cameronnemo/brillo;
+ license = [ licenses.gpl3 licenses.bsd0 ];
+ platforms = platforms.linux;
+ maintainers = [ maintainers.alexarice ];
+ };
+}
diff --git a/pkgs/os-specific/linux/brillo/udev-rule.patch b/pkgs/os-specific/linux/brillo/udev-rule.patch
new file mode 100644
index 000000000000..7b1cf4840675
--- /dev/null
+++ b/pkgs/os-specific/linux/brillo/udev-rule.patch
@@ -0,0 +1,13 @@
+diff --git a/contrib/udev.in b/contrib/udev.in
+index 0625952..a6c940e 100644
+--- a/contrib/udev.in
++++ b/contrib/udev.in
+@@ -1,4 +1,4 @@
+-ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp @group@ /sys/class/backlight/%k/brightness"
+-ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
+-ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chgrp @group@ /sys/class/leds/%k/brightness"
+-ACTION=="add", SUBSYSTEM=="leds", RUN+="/bin/chmod g+w /sys/class/leds/%k/brightness"
++ACTION=="add", SUBSYSTEM=="backlight", RUN+="@coreutils@/bin/chgrp @group@ /sys/class/backlight/%k/brightness"
++ACTION=="add", SUBSYSTEM=="backlight", RUN+="@coreutils@/bin/chmod g+w /sys/class/backlight/%k/brightness"
++ACTION=="add", SUBSYSTEM=="leds", RUN+="@coreutils@/bin/chgrp @group@ /sys/class/leds/%k/brightness"
++ACTION=="add", SUBSYSTEM=="leds", RUN+="@coreutils@/bin/chmod g+w /sys/class/leds/%k/brightness"