As mentioned in Puranas, Nimi was one of the three distinguished sons of Ikshvaku.
Nimi instituted a sacrifice that was to endure a thousand years, and applied to Vasishtha to offer the oblations. Vasishtha in answer said, that he had been pre-engaged by Indra for five hundred years. He said that if Nimi would wait for some time he would come and presided as supervise priest.
The king made no answer, and Vasishtha went away, supposing that he had assented. When the sage had completed the performance of the ceremonies he had conducted for Indra, he returned with all speed to Nimi, purposing to render him the like office. When he arrived, however, and found that Nimi had retained Gautama and other priests to minister at his sacrifice. He was much displeased and pronounced upon the king, who was then asleep, a curse to this effect, that since he had not intimated his intention, but transferred to Gautama the duty he had first entrusted to himself.
When Nimi woke, and knew what had happened, he in return denounced as an imprecation upon his unjust preceptor, that he also should lose him bodily existence, as the punishment of uttering a curse upon him without previously communicating with him. Nimi then abandoned his bodily condition. The spirit of Vasishtha also leaving his body was united with the spirits of Mitra and Varuna for a season, until, through their passion for the nymph Urvashi, the sage was born again in a different shape. The corpse of Nimi was preserved from decay by being preserved with fragrant oils and resins, and it remained as intact as if it were immortal.
When the sacrifice was concluded, the priests applied to the gods, who had come to receive their portions, that they would confer a blessing upon the author of the sacrifice. The gods were willing to restore him to bodily life, but Nimi declined its acceptance. Then he said that he do not want to go back to the worldly life because there is not in the world a deeper cause of distress than the separation of soul and body. It is therefore his wish to dwell in the eyes of all beings, but never more to resume a corporeal shape. To this desire the god's agreed, and they placed Nimi in the eyes of all living creatures and in consequence of which their eyelids were ever opening and shutting.