Preheat oven to 400°F. Toss diced eggplant with half of the olive oil and salt on a baking dish. Bake 30-40 mins until tender. Set aside.
Bring a large pot of salted water to boil, cook pasta for about 7 mins (or according to package directions). Save ½ cup pasta water, drain, and set aside.
Bring a large fry pan to medium heat and sauté onions with the remaining olive oil and salt for 2-3 mins. Add garlic and red pepper flakes and cook for an additional 1 min.
Then, add roasted eggplant, tomatoes, vinegar, half of the walnuts, and the reserved pasta water. Simmer on medium until slightly thickened, or about 5 minutes.
Add cooked spaghetti to the pan and stir until the pasta is well coated and heated through, or about 2-3 minutes.
Lastly, stir in the cream, parmesan, and butter. Remove from the heat and mix until creamy. Taste for saltiness and garnish with the remaining walnuts and some freshly cracked pepper.