Does anyone know where to buy these things in library form legally?
It would be better to create them by yourself. Download FamiTracker, spend about 2-3 hours on reading the tutorial and studying examples, then voila - you get a handful of NES sounds. :)
Also pay some attention to the YMvst plugin.
Chipsounds is fantastic and very user friendly. You can create some very authentic sounds using the presets.
sfxr is a wonderful tool. It was created in 2007 for use in game jams where the creators didn't have time to worry about searching for sounds. It's highly tweakable, but at its core, in my opinion, is the "randomize" button. After a few clicks, you are bound to land on an interesting new sound that fits your needs. It even has categorized generators to randomly generate anything from pickup/coin sounds to explosions to hits. And it all has that 8bit sound.
EDIT: I forgot to mention that it also has a "mutate" button to slightly, but again randomly, alter the sound.
Puremagnetik has a super budget option ($12), for Logic, Live or Kontakt. Punchpak
If you've got a bit more cash to spend, I seriously advise looking into getting the reFX Nexus 2 plugin with the SID expansion.
If you like making electronic music then the Nexus 2 is an amazing plugin to have generally, and well worth the money.
8-bit, Chip-style, Mono/Poly synthesizer.
Dual Oscillators. 4 Octave per OSC. Osc2 Fine tune. Step Sequencer Pitch/Filter. Bitcrusher 8-bit, 16-bit, 24-bit, 32-bit. Filter Section. Amp/Filter ADSR. Harmonics Switch. Reverb/Delay. X/Y Pad. Glide and Glide Rate.