Start by preheating the oven to 400F. While the oven is heating, dice the onion and crush the garlic. Wash the chicken legs. Toast the nuts in a little bit of the butter and grate the carrot.
To a large non-stick pot, add the oil and heat for 1 minute. Then add the onions and cook for 5 minutes until slightly softened. Then add the crushed garlic and cook for another 5 minutes.
Add the tomato paste and cook for 2 minutes until caramelized. Add the whole spices and ground spices, as well as the tomato sauce and 1 cup of water. Allow to simmer for another 3 minutes.
Add the chicken legs and nestle them in the sauce mixture. Cover the pot and allow to cook for 20 minutes, flipping the chicken legs halfway through.
Remove the chicken legs, and place them on a baking sheet lined with foil. To finish cooking them, bake in the oven for 20-25 minutes, until the juices run clear.
Add the rice and raisins to the pot along with the remaining 3 ½ cups of water. Mix well but gently to incorporate the rice. Cover and bring to a low boil for about 20 minutes. Turn off the heat and let the rice stand for 5 minutes.
Once the chicken is baked, broil for 2 minutes to crisp the skin.
Top the rice with the chicken legs, and sprinkle with nuts and grated carrot. Serve hot.