I thought this video was rather interesting, because at 12:27, the presenter crunches the numbers to find out how many years it would take for a new computer purchase to be more environmentally friendly (in regards to total CO2 expended) compared to using a less efficient used model.
Depending on the specific use case, it could take as little as 3 years to breakeven in terms of CO2 if both systems were at max power draw forever, and as long as 30 if the systems are mostly at idle.
In Germany consumer power is something like 0.4 EUR/kWh, so economics of running power-hungry hardware might be different. Solar PV might change the equation once again.
Then you’ll need to factor in the solar initial cost as well!
DIY few kWp solar patback is about 2 years.