Add pistachios to a pan and dry roast over medium-low heat until slightly browned, stirring frequently.
Transfer them to a bowl and keep them aside.
Add cumin seeds and sesame seeds to the same pan and roast until they are browned, stirring continuously.
Transfer to the bowl.
Add coriander seeds and roast them until browned.
Transfer the roasted coriander seeds to the bowl.
Dry roast coconut flakes next and transfer them to the bowl too.
Let the ingredients cool down completely.
Note - If the ingredients are still warm while blending, they might release their oil and the dukkah will become oil.
Add all the roasted ingredients to a grinder (or a mortar and pestle) along with salt and black peppercorns and pulse a few times to make a coarse powder.
Note - Do not grind in one go as the heat from the grinder can make the nuts release their oil and the dukkah become oily.
Transfer the pistachio dukkah to an airtight container and store it in the refrigerator for up to 2 months.