brillo: init at 1.4.8

This commit is contained in:
Alex Rice 2019-04-14 10:53:43 +01:00 committed by Frederik Rietdijk
parent 6928b5c12b
commit 66611546f0
5 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.hardware.brillo;
in
{
options = {
hardware.brillo = {
enable = mkEnableOption ''
Enable brillo in userspace.
This will allow brightness control from users in the video group.
'';
};
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.brillo ];
environment.systemPackages = [ pkgs.brillo ];
};
}

View file

@ -44,6 +44,7 @@
./hardware/all-firmware.nix
./hardware/bladeRF.nix
./hardware/brightnessctl.nix
./hardware/brillo.nix
./hardware/ckb-next.nix
./hardware/cpu/amd-microcode.nix
./hardware/cpu/intel-microcode.nix

View file

@ -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 ];
};
}

View file

@ -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"

View file

@ -15666,6 +15666,8 @@ in
bt-fw-converter = callPackage ../os-specific/linux/firmware/bt-fw-converter { };
brillo = callPackage ../os-specific/linux/brillo { };
broadcom-bt-firmware = callPackage ../os-specific/linux/firmware/broadcom-bt-firmware { };
batctl = callPackage ../os-specific/linux/batman-adv/batctl.nix { };