Cosmological production of dark nuclei