Justice Wylie gave the teen some time off his sentence due to his age and described him as immature.
The court heard Derrick-Hardie carried knives in the months leading up to the killing and discussed stabbing people on Facebook.
On July 29 last year he and his ex-girlfriend were at a birthday party in the east Auckland suburb of Pakuranga.
According to the police summary of facts, Derrick-Hardie's ex had been flirting and talking with Mr Rosillo before Derrick-Hardie asked her to leave with him.
They went to the front of the property where an argument broke out. Crown prosecutor Warren Cathcart said Mr Rosillo stepped in.
Derrick-Hardie accused his ex-girlfriend of being unfaithful. She responded by kissing Mr Rosillo, who returned the kiss.
Derrick-Hardie grabbed Mr Rosillo by the neck, and stabbed him in the chest, face and abdomen.
Mr Rosillo died at the scene.
Derrick-Hardie went on the run but was arrested the next day at the Heritage Hotel in downtown Auckland.