Preheat the oven to 200°C/gas mark 6. Put the oil, onions, butternut squash, peppers, leeks and thyme into a large roasting dish and season. Toss to combine, then roast in the oven for 20-30 minutes, until the veg is tender and golden.
Meanwhile, put the pasta in a large pan of boiling water and cook for 10 minutes. Drain, reserving 200ml of the cooking water, then put the pasta back into the pan. Stir through the spinach until wilted, then mix in the cheese sauce, reserved cooking water and roasted vegetables.
Transfer to a large baking dish and top with the grated cheese. Bake in the oven for 15 minutes, until the top is golden.