1000$/kW is actually pretty cheap for a ~20 kW installation. But it's possible, depending on labour costs in your region. You'd need about 150 m² for the panels. Solar is a long-term investment, amortisation time depending on your latitude and climate ~5-15 years typical.
Do you get the 12 hours of free electricity only if you cover the remaining 12 hours? Even so, you could rent a dgen, earn some bitcoins, then invest in solar and ditch the gen.
Also this:
https://coinmarketcap.com/currencies/solarcoin/ (1 coin = 1 MWh; I'm not really serious but the price has gone up quite a bit lately).