That’s up there for top idiocy I’ve ever seen. Literally all energy on the planet comes from the sun. The only question is storage and conversion to usefulness. Burning coal spews carbon into the atmosphere causing global temperatures to rise. There is a cost to this. Long run direct conversion of solar energy is the cheapest.
Geothermal and nuclear are not solar derivatives. And even though many/most people still consider it fringe, there is strong evidence supporting the abiogenic oil theories. Which would mean oil, or at least some of it, is also not derived from the sun. Same goes for coal. Some is clearly derived from plant matter, as such the energy came from the sun, and some is mineral in origin, meaning it was formed from geologic processes.
Once we have developed a means of converting photons to electricity that does not require massive amounts of rare earth materials, and we solve storage related problems, then I would agree solar is the way to go in the long run.