01 -
Set a saucepan over medium heat and melt the butter. Stir in the onion, letting it soften for 3-5 minutes. Toss in the garlic and thyme, cooking just until the aroma hits, about a minute.
02 -
Add the flour to the pan, mix until smooth, and cook until it barely starts to brown, probably in a minute or less.
03 -
Pour in the milk bit by bit, stirring the whole time so it doesn’t clump. Let it cook until it thickens, around 1-2 minutes. Lower the heat, mix in half a cup of Gruyere, and stir until melted. If using, throw in some nutmeg and add salt and pepper to taste.
04 -
Coat the bottom of a large baking dish with a little sauce. Add a layer of potato slices, then pour on some sauce. Repeat this process until the dish is full. Optionally, dip each potato slice in the sauce before placing.
05 -
Pour the remainings of your sauce all over the layered potatoes. Sprinkle the rest of the Gruyere on top. Bake in a 350°F (180°C) oven for 45-60 minutes or until the potatoes are cooked through.