Well, being allergic to nuts is more serious than most allergic reactions, since it can be fatal, and you can die from it. Most allergies aren't fatal, and most of them are manageable because there are creams and medicines to treat them, but there's no cure for a nut allergy.. you eat one, your life will be on the line. So I think you need to explain to her how serious having a nut allergy is, and that it upset you that she responded with "my bad" because it felt like she didn't care that it could be dangerous for you. If you weren't aware of your allergy and you had one, you would be fighting for your life right now, and your friend would be devastated that they didn't know. I'm sure if you make her aware of how dangerous having a nut allergy is, and you could die, that may make her realise that she has to take that into consideration, and she may even feel bad for not realising how serious it is. That will stick with her, and she won't buy you them again.
Some people just don't remember that you can't have something or eat something because of allergies, and you have to explain to them in a way that they'd remember. So if she forgets again, even after you explain how dangerous it can be, then if she gets you nuts, just refuse to have them, and tell her "Nah, can't eat them, I have an allergy to them and I could die, thanks for thinking of me though" Because how many times would you need to tell her when you could just refuse to eat anything with nuts in. She'll eventually get the hint that you can't eat them, but I understand you shouldn't have to do that. It shouldn't take her many times to realise you can't eat nuts.