but it involves manually configuring the raspberry.
I could create my own iso with just wifi settings, with a default hostname, but it would mean I would have to find the assigned IP during DHCP for each rpi, because the hostname would be duplicated. Right?
Option 2
I could manually set the IPs, but I’m not sure it would work well when moving to a different network (let’s say I move in a couple of months). Would it work well when other devices are using DHCP?
I think this is the use-case for bento; although I’ve yet to try it.
Currently I manage my systems similarly: each has a separate entry in a single flake. They share common config through modules. The ones which boot from sdCard each have another entry to make the OS image – this part still needs a lot of tuning. This is enough for me to bring up most new machines headless – unless I need to tweak BIOS settings.
Each system has a unique hostname. My network DHCP server is configured to add hostnames to its DNS. All lan hosts are addressable as hostname.lan. If a device does not let me set its hostname (my thermostat), I configure the router to assign a name based on MAC address. (I find this easier than trying to manage avahi on all hosts; although I hope to get that working someday.) This generally solves the host discoverability problem.
You even could add some scripts to have the hostname assigned dynamically on first boot. (I expect avahi has this capability.) Then you look at your router console to see what name was assigned, or have them report the name to some other well-known host. This would let you use a single image for multiple machines.
I’ve been managing my home network this way since long before nix existed. Over the years I’ve found considerable value in understanding how to interpret what the router sees – especially as I prefer to run most machines headless.