In a food processor, grind the walnut halves until very fine.
Transfer to a bowl and set aside.
Add the cleaned mushrooms to the food processor and pulse until they are chopped to about the size of a pea.
Set aside separately.
Heat the canola oil in a large frying pan or skillet over medium heat.
Once hot, add the black mustard, cumin, and nigella seeds.
When the seeds begin to pop and wriggle, add the diced onion.
Sauté for about 10 minutes, until the onion is soft and beginning to caramelize.
Stir in the finely chopped green chiles, grated ginger, and crushed garlic.
Cook for another 5 minutes until the onions are a deep golden brown and fragrant.
Add the chopped mushrooms to the pan. They will seem to overflow, but will cook down significantly. Gently fold them into the onion mixture.
Season with salt and black pepper.
Cook for approximately 15 minutes, stirring occasionally, until all the liquid released by the mushrooms has evaporated. The mixture must be dry to avoid soggy samosas.
Stir in the ground walnuts and cook for a final 3 minutes.
Remove the pan from the heat and allow the filling to cool completely before filling and folding your samosas according to your pastry's .
Don't be shy with the seasoning! The flavors will be slightly muted by the pastry, so a well-seasoned, robust filling is key.