The most important thing to know is that (at least in general - there may be/have been a few exceptions, but I don’t know if they still exist or where) U.S. airports don’t allow for international transit without entering the U.S. and being cleared by CBP. That means that you need to go through the same procedures as anyone arriving in the U.S., including clearing through customs.
According to CBP’s website, nuts shouldn’t be a problem if they’re roasted.
The Don’t Pack a Pest website elaborates:
Nuts are allowed entry if they have been boiled, cooked, ground, oven dried, pureed, roasted, or steamed. For guidance on whether certain nuts prepared in other ways (for instance, raw, blanched, or in shells/husks) may enter and under which conditions, please contact USDA’s Plant Import Information Line at 877-770-5990 (Toll-Free) or by email at [email protected]
In any case, during the CBP inspection, any food that you have (even if permitted) must be declared. I haven’t travelled to the U.S. in a few years so I’m not familiar with current entry procedures, but if there’s a form you’re asked to fill out (on paper or electronically) there will be a question there which you should answer “yes” to, if not then you should tell the CBP officer processing your admission.
Also, note that as you’re being admitted into the U.S., even just for the purpose of transit, you’ll need a visa. If you have a second nationality and passport from an applicable country (Brazil doesn’t qualify), you may be eligible to enter under the VWP, in which case you’ll need to make sure to have a valid ESTA approval. Otherwise, you’ll need a visa. If you have an existing valid B-1/B-2 tourist visa or C-1 transit visa that should be fine, if not you’ll need to get one before your trip.