Acquire an image
https://www.raspberrypi.org/downloads/raspbian/
Burn the .img
On macOS.
Find the dev node for the disk:
Pre-first-boot modifications:
A bunch of stuff can be enabled or disabled by dropping magic files into the boot partition which save a bunch of time.
WiFi Config
On the SD card, before booting it for the first time:
Create a file on the boot partition called wpa_supplicant.conf
with these contents:
Enable SSH
On the SD card, before booting it for the first time:
Touch a file called ssh
in the boot folder, this will configure the system to allow ssh.
https://www.raspberrypi.org/documentation/remote-access/ssh/README.md
Enable the camera
sudo raspi-config nonint do_camera 0
https://raspberrypi.stackexchange.com/questions/10357/enable-camera-without-raspi-config/93187#93187
https://www.raspberrypi.org/documentation/configuration/camera.md
Disable the camera LED
First up, we need to edit the config file.
sudo nano /boot/config.txt
Add the following line to the end of the file, then save it.
disable_camera_led=1