My personal playslyle is certainly not for everyone, and once you're at the point you're at, it may be impossible to do now, but perhaps not.
I run an extremely minimal factory to start, and watch my pollution closely. If pollution reaches the nearest nest, I shut down whatever factory is polluting in that direction. I might also go kill the nest. Basically I rush solar panels, and do a lot of hand crafting. Once I have solar, I deconstruct steam power, so my factory only runs in the day. Then I push research, and build walls and gun turrets far out to prevent biters moving too close. I feed the turrets from yellow belt with yellow inserters, which uses less power, is cheaper to build, and has the added benefit of showing the number of yellow inserters in power usage, so you know exactly how many gun turrets you have in your wall. Once I have a massive area walled off, I crank up production, harden the wall, switch turrets to red ammo, and cover the entire walled area with roboports and scanners, so the wall auto-repairs. Once you have nuclear power, you can add laser turrets to your wall.
In your situation, I would turn off power to your entire base, and gather all resources from all belts. Possibly deconstruct everything and build just a central turret nest. Start hand-crafting ammo, walls, and some turrets, and manually keep your turrets loaded, if you have mined ore and are running out of metal, consider manually loading the ore into furnaces, but watch your pollution. Don't mine more unless you're desperate, if you have to, you're probably doomed. Nests should stop attacking once the pollution no longer touches them. Then slowly start up again, and switch over to solar.
