Pre-heat the oven to 180ºC. Boil a kettle full of water then pour into a large pan. Bring back up to the boil, add the spaghetti, reduce the heat and pop on the lid. Simmer until cooked.
Cut the onion into eigths. Wash the aubergine and cut into smallish chunks. Tip onto a non-stick tray with the fresh herbs if using and cover with a couple of squirts of olive oil spray. Massage the oil into the veg with your hands then place the tray in the oven for 12 minutes.
Wash the cherry tomotoes and pop them on the baking tray with the other veg. Roast for another 5 minutes or so until they are soft and bursting.
The spaghetti should be cooked by now, so drain off the water and return to the pan. Remove the baking tray of veg from the oven and tip into the drained spaghetti. Season with salt and pepper and add a glug of oil if using. Toss well then transfer to serving plates or bowls.
Sprinkle the walnuts and rocket over the top and serve immediately.