{ pkgs, lib, config, ... }: { options = { hardware.raspberry-pi.cec.enable = lib.mkEnableOption "raspberry pi cec software"; }; config = { services.udev.extraRules = '' # allow access to raspi cec device for video group (and optionally register it as a systemd device, used below) KERNEL=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq" ''; environment.systemPackages = with pkgs; [ libcec ]; }; }