Do in boot partition
touch /path/to/boot/ssh
create File wpa_supplicant.conf
network={ ssid="networkname" psk=xyz
userconf.txt content user:pw
From https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-a-user