From a619bea0fcc0aa314703b3ded2f1e7f8ab93ad38 Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 26 Aug 2023 08:04:11 +0200 Subject: [PATCH] Allow users in the video group to change the screen brightness. --- services/desktop.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/desktop.nix b/services/desktop.nix index 9c1a530..3c78263 100644 --- a/services/desktop.nix +++ b/services/desktop.nix @@ -52,5 +52,9 @@ in mkIf (elem "desktop" cfg.services) { }; }; }; + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness" + ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod 664 /sys/class/backlight/%k/brightness" + ''; machine.pkgsets.python3.pkgs = with pkgs.python310Packages; [ py3status pytz tzlocal ]; }