Toast the walnuts in a large dry pan over medium heat. Keep a careful eye on them and shake the pan often as they can burn quickly. As soon as they start browning on the edges remove them from the heat. Remove the walnuts from the pan onto a heat-safe dish, or directly into your food processor if your food processor can handle hot food.
Return the pan to the heat and add the olive oil. When hot add the onions and garlic and sauté until the onions soften and turn translucent about 4 minutes.
Add in all the remaining ingredients, the mushrooms, parsley, rosemary, salt, and pepper and sauté until the mushrooms have cooked and reduced in size, another 5 - 8 minutes. If the mushrooms are sticking to the pan you can add a small splash of water to help release them. As the mushrooms cook they will release their own liquid.
If your food processor can handle hot food, add the mushrooms to the food processor along with the walnuts. If not, just let the mushrooms and walnuts cool first. Pulse, stopping to scrape the sides as needed until you reach a pâté texture.
Press into a container for serving using a spatula to smooth it, and let it chill completely in the fridge before serving.