What do you mean "self-hosted security camera" exactly? Open source camera? DIY camera?
Or are you looking for self-hosted NVR software? If so, many people already gave you suggestions. My recommendation - don't focus on ZoneMinder. It's ugly software. Instead, use Shinobi for more classic software or Frigate with Google TPU accelerator. Both lightweight enough.
Myself I have a mix of HikVision and Dahua, recorded/analyzed by Frugate. Everything works like a charm.
And also, I've disabled internet access for all the cameras, so they couldn't call home. ¯\_(ツ)_/¯