NixOS on ARM/Raspberry Pi 4: Difference between revisions

imported>Valodim
add some usage info on HDMI-CEC
imported>Valodim
slightly improve hdmi-cec with systemd device alias
Line 228: Line 228:
   services.udev.extraRules = ''
   services.udev.extraRules = ''
     # allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
     # allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
     SUBSYSTEM=="vchiq", GROUP="video", MODE="0660", TAG+="systemd"
     SUBSYSTEM=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
   '';
   '';


Line 235: Line 235:
   # set pi as active source: `echo 'as' > /run/cec.fifo`
   # set pi as active source: `echo 'as' > /run/cec.fifo`
   systemd.sockets."cec-client" = {
   systemd.sockets."cec-client" = {
     after = [ "sys-devices-platform-soc-fe00b840.mailbox-vchiq-vchiq.device" ];
     after = [ "dev-vchiq.device" ];
     bindsTo = [ "sys-devices-platform-soc-fe00b840.mailbox-vchiq-vchiq.device" ];
     bindsTo = [ "dev-vchiq.device" ];
     wantedBy = [ "sockets.target" ];
     wantedBy = [ "sockets.target" ];
     socketConfig = {
     socketConfig = {
Line 245: Line 245:
   };
   };
   systemd.services."cec-client" = {
   systemd.services."cec-client" = {
     after = [ "sys-devices-platform-soc-fe00b840.mailbox-vchiq-vchiq.device" ];
     after = [ "dev-vchiq.device" ];
     bindsTo = [ "sys-devices-platform-soc-fe00b840.mailbox-vchiq-vchiq.device" ];
     bindsTo = [ "dev-vchiq.device" ];
     wantedBy = [ "multi-user.target" ];
     wantedBy = [ "multi-user.target" ];
     serviceConfig = {
     serviceConfig = {