That is not true on many accounts. The decision to phase out nuclear energy was taken in the beginning of the 2000 years. There was some extension of the operating time when Merkel came to power, which was taken back after Fukushima. This also affects plants which are very old, so would need to be replaced or undergo some severe modernisation anyway. There have been no new German nuclear power plants since the early 80ies.
Then, Germany always depended on fossil fuels. Nuclear power was never more than 30% of the electricity mix, not counting heating and transportation. And except coal, the fossil fuels are all imported. The only energy source we can grow domestically are renewables.
So yes, we depend on gas import, as this is the cleanest fossil fuel available. Currently most of it is coming from Russia, a trade which is beneficial to both countries. But there would be other sources if needed, the US is applying considerable pressure to Germany, so we buy gas from the US instead.