Core–shell and matryoshka structures in MgNi nanoalloys: a computational study