When you buy a house with an existing solar energy do you get a tax credit?

is it the cost of what you paid for the property or the solar system?