Nuclei in the cosmos