Text this: All-optical control of long-lived nuclear spins in rare-earth doped nanoparticles