Drying-mediated self-assembly of nanoparticles