The necrons of course don't give a crap about living on worlds that have been stripped of life (heck, their pylons do this) so inheriting Tyranid discards would be just fine for them. Although I'm sure they'd be retroactively pissed that there was so much life they missed having a chance to kill. But they're used to being safely buried for billions of years, so whatevs.
Actually, the Necrons are already opposing the Tyranids. Szarekh, who used to be the Silent King in charge of the entire Necrontyr species, views the Tyranids as the greatest threat there is to the dream of his people regaining biological bodies (and thus their souls), so he is marshalling tombworlds against the Great Devourer. The whole "all necrons want to eradicate all life" thing has been tossed out the window by Games Workshop.