The nuke part is optional, see:
https://en.wikipedia.org/wiki/Counter-electronics_High_Power...
that said, there have been multiple past nuclear EMP orientated tests: https://en.wikipedia.org/wiki/Nuclear_electromagnetic_pulse
results vary by location (earth's mag field) and pre hardening of infrastructure.