For the Garam Masala
2 tbsp. poppy seeds
1 tbsp. coriander seeds
1 tsp. cumin seeds
1 tsp. fennel seeds
1⁄2 tsp. whole black peppercorns
1⁄4 tsp. freshly grated nutmeg
5 whole cloves
3 green cardamom pods
1 black cardamom pod
1 whole star anise
1 stick cinnamon, halved
For the Nihari
1 cup canola oil
1 medium yellow onion, very thinly sliced
3 lamb shanks, halved crosswise
1 tbsp. cayenne
2 cloves garlic, mashed into a paste
1 (3″) piece of ginger, peeled (1″ mashed into a paste, 2″ julienned, for serving)
1⁄4 cup flour
2 tbsp. ghee, melted
Chopped cilantro, lemon or lime wedges, minced Thai chiles, and naan bread, for serving (optional)
Kosher salt, to taste
Make the garam masala: Purée poppy seeds and 1 tbsp. water in a spice grinder into a paste; transfer to a bowl. Grind remaining spices into a powder; stir into paste.
Make the nihari: Heat oil and onion in a 6-qt. saucepan over medium. Cook until onion is caramelized, about 25 minutes; using a slotted spoon, transfer onion to a bowl. Discard all but 1⁄4 cup oil from the pan. Cook lamb, turning as needed, until browned, 8–10 minutes. Stir in reserved garam masala, the cayenne, garlic and ginger pastes, and salt; cook 1–2 minutes.
Add 3 cups water; boil. Reduce heat to medium-low; cook, covered, until lamb has fallen off the bone, 5 1⁄2–6 hours. Using tongs, transfer lamb to a bowl; keep warm. Stir flour, ghee, and 1⁄4 cup water in a bowl and add to pan; cook until thickened, about 15 minutes.
Return lamb to pan. Serve with the reserved onion, julienned ginger, and, if you like, the cilantro, lemon or lime wedges, chiles, and naan.