The sale is definitely a valid one but the condition imposed is not.
Nikhil is the absolute owner of the house after he purchased it from Harshvardhan. According to Section 55(6) of The Transfer of Property Act, the buyer has the right to the benefit of any improvement in, or increase in value of, the property, and to the rents and profits thereof. Nikhil can transfer, make a sale, gift, lease, mortgage the house to whoever, whenever and however he wishes to. Harshvardhan cannot restrain Nikhil from selling the house, selling or transferring property is an inherent right of every owner, which cannot be denied by imposition of restrictive conditions. Section 10 of The Transfer of Property Act, 1882, explains that when property is transferred subject to a condition or limitation which absolutely restrains the transferee or any person claiming under him from parting with or disposing of his interest in the property, the condition or limitation is void. In this case, the condition imposed by Harshavardhan restrains NIkhil from transferring his property thus the condition is void. Nikhil can go ahead and sell his house to anyone, Harshvardhan has no claim over the house anymore.