I don't consider the Iranian groups working with us to fight ISIS to be particularly significant. A bigger evil often makes strange bedfellows. In WWII, we teamed up with Stalin to defeat Hitler. During the Cold War we funded and supplied Mujahideen fighters in their insurgency against the USSR. Some of those same people later orchestrated 9/11. Once the greater evil is gone, the one time allies often fall back into being enemies.
As for the nuclear deal, it was doomed from the start. It wasn't going to prevent Iran from getting nukes if they wanted them. Also, there were inevitably going to be sanctions put back in place against Iran due to their meddling in the region. That would have torpedoed the nuke deal eventually. There was no particular reason to pull out of that agreement when he did but destruction of the agreement is no great loss. It was only going to last as long as it was convenient.
The situation with Iran is bad. I don't think there's any course of action that could have been taken by any President in the last 30 years that would have resulted in a good situation with Iran at this point. The situation is far bigger and more complex than a single treaty or drone strike. There are geopolitical issues centuries in the making underlying this conflict. It's short sighted and simplistic to blame the way things are on any one man be he Trump, Obama, Bush or whoever.