A flexible new route to designer materials built from nanoparticles