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 = [ " | after = [ "dev-vchiq.device" ]; | ||
bindsTo = [ " | 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 = [ " | after = [ "dev-vchiq.device" ]; | ||
bindsTo = [ " | bindsTo = [ "dev-vchiq.device" ]; | ||
wantedBy = [ "multi-user.target" ]; | wantedBy = [ "multi-user.target" ]; | ||
serviceConfig = { | serviceConfig = { |