Preheat oven to 400°F (200°C). Grease an 8×8-inch baking dish.
Cook pasta 2 minutes less than al dente. Drain and reserve 1 cup pasta water.
In a saucepan, melt butter.
Whisk in flour, onion powder, garlic powder, thyme, salt, and pepper. Cook 1 minute.
Gradually whisk in milk and Dijon mustard. Bring to a simmer until thick.
Remove from heat and stir in 1 cup cheddar and Gruyère cheese until melted.
Add pasta water to thin if needed.
See full steps with tips & photos → https://theboatshedcafe.com/baked-ham-and-cheese-pasta/