-
Preheat oven to 375 degrees F. Butter a 9x13 baking dish.
-
Melt butter in a saucepan over medium heat. Whisk in flour and cook for 1 minute, stirring constantly.
-
Gradually add warm milk, whisking continuously until smooth. Cook for 5 to 7 minutes, stirring often, until the sauce thickens enough to coat the back of a spoon.
-
Remove from heat and stir in the cheddar and Gruyere until melted and smooth. Season with nutmeg, thyme, salt, and pepper.
-
Layer one-third of the sliced potatoes in the prepared dish. Pour one-third of the cheese sauce over the top. Repeat with two more layers, ending with sauce on top.
-
Cover tightly with foil and bake for 45 minutes. Remove foil and bake for another 25 to 30 minutes until the top is golden brown and the potatoes are tender when pierced with a knife.
-
Let rest for 10 minutes before serving.