What books do I need to get all the rules for the Tyranid armies units/formations/detachments?
Current main resources for Tyrannids are


Codex


The Codex is the only one that is needed to run a Tyranid army, but the Shield of Baal series and Rising Leviathan dataslates do provide some additional formations (noted with the [F] below).

Additional resources include:


Shield of Baal: Deathstorm (Children of Cryptus, Phodian Hive Warriors, The Beast of Phodia, Phodian Annihilation Swarm [F])
Shield of Baal: Leviathan (Hive Fleet Detachment, Mucolid Spore Cluster, Zoanthrope Brood, Maleceptor,Toxicrene, Tyrannocyte, Sporocyst, Hypertoxic Node [F], Neural Node [F], Skytyrant Swarm [F], Skyblight Swarm [F], Sporefield [F], Skytide [F])
Start Collecting! Tyranids (Hive Vanguard [F])
Dataslate Tyranid Vanguard - Rising Leviathan I (Lictor Forest Brood [F], Manufactorum Genestealers [F], Deathleaper's Assassin Brood [F], Broodlord's Hunting Pack [F], Gargoyle Bio-Bombs [F])
Dataslate Tyranid Invasion - Rising Leviathan II (Incubator Node [f], Synaptic Swarm [F], Skyblight Swarm [F], Living Artillery Node [F], Endless Swarm [F])
Dataslate Tyranid Onslaught - Rising Leviathan III (Bioblast Node [F], Wrecker Nide [F], Tyrant Node [F], Subterranean Swarm [F], Living Tide [F])


As for holding off to buy them, that's your call. Rumour has 8th Ed dropping around June/July apparently, that said though it will take time for them to update all the current codex's to the new edition, so by no means will they be immediately invalidated.