Preheat the oven to 350 degrees F (175 degrees C). Place walnuts on a baking sheet. Bake for 8 to 10 minutes in the preheated oven, or until they release their aroma. Stir once or twice for even toasting.
Heat oil in a large heavy saucepan over medium-high heat. Saute onion and mushrooms until tender and golden brown.
Pour in broth, and bring to a boil. Stir in orzo, reduce heat to low, and cover. Simmer until orzo is tender and liquid is absorbed, about 15 minutes. If after 15 minutes there is still liquid, remove cover, and cook until liquid is gone. Remove from heat, and stir in walnuts. Season with salt and pepper to taste.