Closing down all nuclear plants was first decided on in the year 2000, 24 years ago. It were the Liberals (FDP) and Christian Democrats (CDU/CSU) who rescinded that decision in 2010, only to later reinstitute it in panic after the Fukushima meltdown happened.
Those reactors that got shuttered hadn't had any safety inspections in years, they had no viable fuel left and not even the owning energy companies wanted to operate them any longer than absolutely necessary, so they would have been shut down even without the Green party in the current government.
That the now missing nuclear baseload had to have been replaced with coal, well.. Thank the Christian Democrats for that. They're the ones that favoured building out coal, slowing down the build-out of renewables as much as possible, at every chance they got.