Bring a large pot of salted water to a boil. Meanwhile, pulse the walnuts in a food processor until finely chopped; remove to a small bowl. Add half the mushrooms to the food processor; pulse until finely chopped. Slice the remaining mushrooms.
Heat the olive oil in a large dutch oven over medium-high heat. Add the walnuts; cook, stirring, until toasted, about 2 minutes. Add the onion and chopped mushrooms and cook, stirring, until the mushrooms are dry, 5 minutes. Season with salt and pepper and cook until the mushrooms are browned, 2 to 3 minutes. Add the sliced mushrooms and garlic and cook until softened, 3 to 5 minutes. Add the tomato paste and cook, stirring, until coated, about 1 minute. Add the crushed tomatoes, then rinse the empty can with 1/2 cup water and pour it into the pot. Add the rosemary and bring to a simmer. Cook, stirring, until the sauce thickens slightly, about 10 minutes.
When the sauce is almost ready, add the pasta to the boiling water and cook as the label directs for al dente, about 5 minutes. Using tongs, transfer the pasta to the sauce. Cook, tossing, until well coated. Stir in half the parsley and season with salt and pepper; remove the rosemary sprig. Divide the pasta among bowls and top with the remaining parsley.