Melt the butter and sugar in a large skillet over medium heat and add the salt. Add the almonds, cashews, peanuts, pecans, chili powder, cinnamon, cumin and cayenne. Cook until the sugar is melted and the nuts are fragrant, 5 to 6 minutes. Add the rosemary and toss. Immediately spread the nut mixture on a parchment-lined baking sheet. Cool completely, and then serve.