Cook pasta in a large pot of salted, boiling water. Drain 2 minutes shy of package instructions and set aside.
Melt butter in a large skillet over medium heat. Add the onion, garlic, and thyme, cooking until onions are soft (~5 minutes). Stir in flour and cook for about 3 minutes, then add milk- stirring until sauce begins to thicken (a few minutes).
Remove sauce from heat and stir in cheddar. Add squash, mustard, nutmeg, cayenne, and black pepper and mix in. Season to taste with salt.
Pour cheese sauce over pasta until sufficiently coated. Using a spatula, transfer to a 9x13 baking dish.
Bake in a 375 degree oven until sauce bubbles around the edges (25-30 minutes).