Raspberry Pi provides a hardware camera interface and API based on libisp, libcamera and rpicam-apps.
My project which brings the above parts together into a draft flake-based Nixos module.
The module sets up runs a simple RTSP broadcasting server on a RaspberryPi 4B board, offering few or no configurable options. I do not currently plan to enhance anything or make tests with other boards. Still, I hope that it might become a reference example for other programmers.
Please let me know if you want me to share the link on the Nixos raspberry pi wiki page or somewhere else.