The goal is to be at 100% with renewable energy in 2050. The closing down of the nuclear power plants is only one milestone on that way. The fossil-based plants will be reduced over time, too. As a bridge technology gas power plants are seen which make it possible to use heat and electricity. Those have an extremely high degree of efficiency. The gas supply is there. New pipelines are being built currently.
Closing down the nuclear power plants is one goal. They are extremely expensive and they need huge amounts of money which we need to invest in renewable energy technology. Also the nuclear industry favors the big corporations who prevent market mechanisms and try to undermine any new energy source. They are also not flexible enough to be used in a future energy mix.
Given that the goal is to go fully to renewable energy in the next 40 years, the nuclear power plants have to go first. The acceptance for them in the German society is also at an all time low.