Actually, I have a MUCH easier method to fight vs Nydras worms.
I had NO TANKS, NO BCs, NO PERD TOWERS, and NO MARINES.
The best strategy I found was actually MASS GHOSTS with range upgrade.
I started with auto refinery so at start I basically have 9 extra workers. I started pumping 5 new workers right away and then make my dual tech attachment to my barracks. Also make a Shadow OPs at this time, and start cranking out Ghost as soon as you can. Perm clock them before sending them out to the front. Also research all 3 infantry upgrades then do the armor. Ignore ship and vehicle upgrades since you wont be needing them.
Next, salvage all the bunkers and make 4 Command centers at the 2 chokepoints, filling in the 2 tiny gaps with 2 supply depots so not even zerglings can make it through. Don't worry about the 'low HP' factor of the SDs since depots have no attack, they won't attract any aggro. I had never had to repair any of them. As soon as the 4 CC are built, use their starting energy to summon MULEs to mineral gathering, then immediately convert them to planetary fortresses. When the FTs are complete, make about 5-7 SCVs at each choke for repairs.
Place the starting 2 tanks in siege mode behind the 4 PFs, and they, along with your starting medics and marines, should hold you through the first few waves till you ghosts start coming in.
In the meantime, build 8 or so missile turrets on the artifact ledge, along with 2 psi disruptor at each choke there.. Leave 2-3 SCVs to repair there.
You would also want to ring your bottom perimeter wtih missile turrets as well for the overlord rush. You will have an abundance of minerals, so be free with the turrets.
When gas permits, turn your main CC into a PF as well. This will help defend your mineral line vs stray zergs that the overlords may drop into your base, or from a particularly deep Nydras worm.
With the 2 chokepoints blocks by the 4 PFs, mass your cloaked ghosts behind them in a loose mass. Don't group them too tightly or Kerrigan may unleash her AOE attack. Place 3-4 medics in the back to heal your SCVs as needed. As the battle progress, you will lose most of the starting marines and mauraders, but you will fill out your pop limit with ghosts.
The masses of zerg will not penetrate your PFs with your 6-8 SCVs repairing them. In fact, no matter how many Nydras worms spawn outside, the simply isn't enough rooms to fit the number of zergs needed to out damage your repair rate. Extra zerg units will only block each other. With their 8 range (after upgrade) your ghost can hang back and pick them off easily.
Keep your 3 starting banshees and 2 BCs around take out any sunkens that get built in range to affect your missile turrets. Otherwise, just keep them in the base to patrol your mineral line. You should have 10-15 ghost on the artifact ledge on each side and around 15-20 behind the PTs.
If done right, you should barely lose any units or buildings at all.
Good luck!