Battery + Power source to Arduino Nano
No switch will be needed. 6 X 1.5v = 9v battery voltage. Since 12v is larger than 9v, when the power supply is plugged in to AC, power at the Vin pin is automatically selected to come from the power supply, not the battery.