Bring a large pot of salted water to a boil over medium-high heat.
Cook the pasta to al dente according to the package directions. Reserve 1 cup of pasta water and then drain.
In a large heavy-bottomed pot or Dutch oven, heat the olive oil over medium heat.
Once fragrant, add the shallot and cook for 2-3 minutes or just until the shallot is tender.
Next add the garlic, thyme, and red pepper flakes. Stir and cook for an additional minute.
Add the butter and allow it to melt, stirring occasionally.
Once the butter is melted, add the flour and stir– a thick paste should form.
Continue stirring for 1-2 minutes or until the flour has turned from white to light brown.
Slowly add the milk, stirring constantly. If there are any large lumps of flour in the sauce, use a whisk to break them up.
Once the milk has been incorporated into the roux, add the reserved pasta water. Allow the sauce to cook for 3-4 minutes or until it is thickened enough to coat the back of a spoon.
Remove the sauce from the heat and add the white cheddar cheese and ground nutmeg. Stir until the cheese has melted.
Then, add the pasta and stir to combine.
Store any leftover mac and cheese in an airtight container in the fridge for up to three days