* The problem I've defined the following udev-rule in my configuration (full configuration attached)
#+BEGIN_SRC scheme (... some omitted lines ...) (udev-service-type config => (udev-configuration (inherit config) ;; SEE: https://unix.stackexchange.com/questions/459874/udev-doesnt-want-to-run-chgrp-and-chmod (rules `(,(udev-rule "90-backlight.rules" (string-append "ACTION==\"add\"," "SUBSYSTEM==\"backlight\"," "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/intel_backlight/brightness\"" "\n" )) ,@(udev-configuration-rules config))))) (... some omitted lines ...) #+END_SRC This made it possible to change the gorup for the file (see proof below) #+BEGIN_SRC sh ls -l /sys/class/backlight/intel_backlight/brightness #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE -rw-r--r-- 1 root video 4096 Sep 17 20:48 /sys/class/backlight/intel_backlight/brightness #+END_EXAMPLE I'm user =rdrg= (see proof below) #+BEGIN_SRC sh whoami #+END_SRC #+RESULTS: #+begin_example rdrg #+end_example I belong to group =video= (see proof below) #+BEGIN_SRC sh cat /etc/group #+END_SRC #+RESULTS: #+begin_example root:x:0: wheel:x:999:rdrg,rdrg-experiments users:x:998: nogroup:x:997: tty:x:996: dialout:x:995: kmem:x:994: input:x:993: video:x:992:rdrg,rdrg-experiments,gdm audio:x:991:rdrg,rdrg-experiments netdev:x:990:rdrg,rdrg-experiments lp:x:989: disk:x:988: floppy:x:987: cdrom:x:986: tape:x:985: kvm:x:984:guixbuilder01,guixbuilder02,guixbuilder03,guixbuilder04,guixbuilder05,guixbuilder06,guixbuilder07,guixbuilder08,guixbuilder09,guixbuilder10 guixbuild:x:30000:guixbuilder01,guixbuilder02,guixbuilder03,guixbuilder04,guixbuilder05,guixbuilder06,guixbuilder07,guixbuilder08,guixbuilder09,guixbuilder10 messagebus:x:983: polkitd:x:982: geoclue:x:981: colord:x:980: avahi:x:979: scanner:x:978: gdm:x:977: sshd:x:976: #+end_example But I can't edit that file as a regular user (see proof below) #+BEGIN_SRC sh echo 0 > /sys/class/backlight/intel_backlight/brightness echo Exit code: $? #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE bash: /sys/class/backlight/intel_backlight/brightness: Permission denied Exit code: 1 #+END_EXAMPLE It is worth mentioning that I can edit that file as =sudo= #+BEGIN_SRC sh echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness echo Exit code: $? #+END_SRC #+RESULTS: #+BEGIN_EXAMPLE 0 Exit code: 0 #+END_EXAMPLE * The questions 1. Why can't I edit =/sys/class/backlight/intel_backlight/brightness= even though the file belongs to the =video= group? 2. What's the proper way to make it possible to edit =/sys/class/backlight/intel_backlight/brightness=? I need to do this because I want to define a keybinding in my windows manager that changes the brightness.
(use-modules (gnu)) (use-service-modules networking ssh avahi ;; sddm-service-type sddm ;; gdm-service-type xorg ;; %desktop-services desktop) (use-package-modules ssh certs) (define %my-services ;; We need to modify the service. Otherwise, we get the following ;; error ;; ;; guix system: error: service 'guix-daemon' provided more than once (modify-services %desktop-services (delete gdm-service-type) (guix-service-type config => (guix-configuration (inherit config) (discover? #t) (authorized-keys (append (list (local-file "./public-keys/delta.pub")) %default-authorized-guix-keys)))) (udev-service-type config => (udev-configuration (inherit config) ;; SEE: https://unix.stackexchange.com/questions/459874/udev-doesnt-want-to-run-chgrp-and-chmod (rules `(,(udev-rule "90-backlight.rules" (string-append "ACTION==\"add\"," "SUBSYSTEM==\"backlight\"," "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/intel_backlight/brightness\"" "\n")) ,@(udev-configuration-rules config))))))) (operating-system (host-name "sony") (locale "en_US.utf8") (timezone "America/Lima") (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (targets '("/boot/efi")))) (file-systems (cons* (file-system (device (file-system-label "my-efi")) (mount-point "/boot/efi") (type "vfat")) (file-system (device (file-system-label "my-root")) (mount-point "/") (type "ext4")) (file-system (device (file-system-label "my-home")) (mount-point "/home") (type "ext4")) %base-file-systems)) (users (cons (user-account (name "rdrg") (comment "This is a comment for user rdrg") (group "users") (supplementary-groups '(;; Make the user a sudoer "wheel" ;; Allow the user to play sound "audio" ;; Allow the user to access the webcam "video"))) %base-user-accounts)) ;; Globally-installed packages (packages (cons* ;; This is mandatory. Otherwise, the following error will be shown: ;; SSL certificate is invalid. Information on how to fix such ;; problem on ;; https://github.com/pjotrp/guix-notes/blob/927a46dc754770ec52d3ac047b58a1ac6fbb6a64/INSTALL.org#guix-pull-error-git-error-the-ssl-certificate-is-invalid nss-certs %base-packages)) (services (cons* ;; SSH server (service openssh-service-type (openssh-configuration (openssh openssh-sans-x) (port-number 2222))) ;; TODO: This doesn't make sddm show sway. ;; ;; SEE: https://lists.gnu.org/archive/html/help-guix/2020-12/msg00235.html ;; (service sddm-service-type ;; (sddm-configuration ;; (auto-login-user "rdrg") ;; (auto-login-session "sway.desktop") ;; (display-server "wayland"))) %my-services)))