Nonmagnetic to magnetic nanostructures via ion irradiation