This!
I’m sure Google (etc) could lure a lot of young, single folks out to the hinterlands for a year or two, but retention and recruiting further up the ladder would be awful.
Universities in the US, which—for historical reasons-are often located in rural areas, have similar problems. They solve this through “spousal hires.” This can range from merely coordinating interviews and offers across departments [0] to creating entirely new positions, or even tenure lines, for a rockstar’s spouse.
This can work relatively well for universities, but I’ve never heard of companies doing anything similar. I wonder if you could even get a set of companies to agree to preferentially hire their employees’ spouses, so there’s a more diverse set of options.
[0] The university often kicks in some money so that both departments will be happy with (say) their number three picks, instead of history hiring an unattached rockstar and chemistry getting no one.