{ config, pkgs, ... }: { imports = [ ./hardware-configuration.nix ../server.nix ]; hardware = { raspberry-pi."4" = { apply-overlays-dtmerge.enable = true; audio.enable = false; fkms-3d.enable = true; # VideoCore with 512 MB CMA reservation tc358743.enable = true; # HDMI-to-CSI-2 converter xhci.enable = false; }; firmware = with pkgs; [ firmwareLinuxNonfree wireless-regdb ]; }; networking = { hostId = "731d1660"; firewall = { enable = true; allowedTCPPorts = [ 8080 ]; allowedUDPPorts = [ 8080 ]; }; }; systemd.services.ustreamer = { enable = true; description = "uStreamer service"; unitConfig = { Type = "simple"; }; serviceConfig = { ExecStartPre = ''${pkgs.v4l-utils}/bin/v4l2-ctl \ --device=/dev/video0 \ --fix-edid-checksums \ --info-edid ''; ExecStart = ''${pkgs.unstable.ustreamer}/bin/ustreamer \ --device=/dev/video0 \ --resolution=1280x720 \ --format=uyvy \ --encoder=m2m-image \ --workers=3 \ --persistent \ --dv-timings \ --drop-same-frames=30 \ --host=0.0.0.0 \ --port=8080 ''; }; wantedBy = [ "network-online.target" ]; confinement.mode = "chroot-only"; }; environment.systemPackages = with pkgs; [ git neovim libraspberrypi raspberrypi-eeprom v4l-utils unstable.ustreamer ]; system.stateVersion = "24.05"; }