Engineering metal-impurity nanodefects for low-cost solar cells