Nightmare Moon always had a backup plan if she ever were defeated; she would slowly regenerate herself and regain her power. The problem is she never expected to come back as a defenseless filly, or to return directly in front of the princesses. As punishment for her past crimes, Luna has given her a sentence far worse than being sent to the moon again. Nightmare Moon must move in with Twilight and report to Luna on the magic of friendship. She's not very happy about it.
By the way I am not trying to rip off Past Sins in any way. Nyx is NOT in this story, this will go in a completely different direction.