This should be one of your first achievements. When you first access a vending machine, you will have quite a bit of credits, enough so to buy all the nanomachines and upgrade your weapon. Just go into the ‘upgrade’ option and increase whatever attribute to your weapon you desire.