Preheat oven to 300°.Place nuts in a medium heatproof bowl. Pour oil into a small heavy saucepan and place over medium-low heat until warm. Do not let it get too hot – the oil will burn. Add rosemary and thyme and stir until aromatic, about 1 minute. Remove pan from heat and stir in cumin and cayenne pepper. Pour the flavored oil over the nuts and stir to coat evenly. Sprinkle with sugar, salt, and black pepper. Stir again. Transfer to a jelly roll pan or a baking pan with sides. Bake for about 15 minutes total, stirring after the first 10 minutes. Let cool. Store in an airtight container for up to two weeks.