Slice the potatoes ⅛ inch thick. Arrange in a greased 13x9 inch baking dish.
Warm the milk in the microwave or a saucepan or until just warm (do not boil).
Melt the butter in a large saucepan over medium heat. Add the shallots and sauté until the shallots are soft.
Add the flour and stir for 30 seconds. Add the warmed milk, whisking as you add it. Whisk until the flour is incorporated into the milk and no lumps remain. Continue cooking until the mixture thickens just a bit, about 30 seconds.
Stir in the salt, thyme, and half of the Gruyere cheese.
Pour the cheese sauce over the top of the potatoes in the casserole dish.
Top with the remaining Gruyere.
Bake for 50–60 minutes, or until the sauce is bubbling and the top is golden brown. Serve immediately.
Notes
Cheese alternatives: cheddar or gouda would be delicious instead of the gruyere!You can use ¾ teaspoon dried thyme in place of fresh thyme, if you don't have fresh thyme.