The derelict complex will be transformed into a new headquarters for the state water agency.