Preheat the oven to 375°F / 190°C. Mix 1½ teaspoons of ground allspice, 1 teaspoon of ground cinnamon, ½ teaspoon of ground coriander, ⅛ teaspoon of black pepper, ⅛ teaspoon of ground cardamom, and 1 pinch of ground nutmeg.
Rub 6 bone-in, skin-on chicken legs with a little olive oil, salt, 1 teaspoon of sumac, and a little less than half of the spice mix. Roast for about 1 hour, until the chicken reaches 165°F / 74°C.
Meanwhile, put 6 chopped yellow onions in a large skillet with ½ cup of extra virgin olive oil, 1 tablespoon of sumac, 1 tablespoon of ground cumin, the rest of the spice mix, and salt.
Cook over medium-low heat for 30-40 minutes, stirring occasionally and adding a splash of water whenever it looks dry, until the onions are completely soft.
Cover the chicken loosely with aluminum foil and rest it for 15 minutes while you heat the broiler. Dip the edges of 6 Greek pita breads in the oil from the onions and set them on baking sheets.
Spread the onions over the bread, leaving a border, and sprinkle with a little sumac and ⅓ cup of toasted pine nuts. Broil for 2-4 minutes, watching closely, until the edges and onions are browned. Top each with a chicken leg.