Sauté walnuts briefly in 1 tablespoon olive oil. Mix in rosemary. Break Parmesan into small pieces. Peel garlic. Puree walnuts with Parmesan cheese, garlic and 6 tablespoons olive oil.
Rinse and trim spinach. Peel and dice onion. Cut sun-dried tomatoes into small cubes. In the remaining olive oil, sauté onion and sun-dried tomatoes. Add spinach and cook until wilted. Season with salt and pepper.
Cook penne in plenty of salted boiling water until al dente, according to package directions. Drain pasta and mix with spinach and sun-dried tomatoes. Serve pasta topped with walnut pesto.