It's not just metals you can smelt, you can also smelt silicon from rocks. It ends up in a melt of iron and silicon, but one could potentially separate out the silicon and use it to make solar cells.[0] Which can then be used to power more electrolysis units to make more solar cells.
[0]https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/200501...