A new solar farm will help power thousands of homes under construction in County Durham.