Cook the macaroni noodles according to the package instructions
In a small bowl, combine the cumin, red chili powder, paprika, coriander, nutmeg, and black pepper. Mix to combine.
Cook rice according to the package instructions, but add 2 tbsp of spice mix into the water. You can use these instructions for cooking white rice in the Instant Pot.
While the rice is cooking, make the tomato sauce.
Put the tomato sauce, cinnamon, bay leaf, and the remainder of the spice mix in a pot or pan and heat for 10 minutes, stirring occasionally.
Slice the onions very thin. Add a layer of oil to the bottom of a pot or pan. When the oil is hot enough that dropping an onion in causes the oil to bubble, you can begin frying.
Add the onions into the oil and allow them to fry until crispy. Remove from the oil and set on a paper-towel lined plate. Set aside.
In a small bowl, layer onions, chickpeas, lentils, sauce, macaroni, then rice, in that order. Flip the bowl over onto a plate, allowing the koshari to release itself from the sides. Lift away the bowl and enjoy!