Prepare for baking. Preheat the oven to 400°F. Lightly grease an 8-inch baking dish with cooking oil or butter, then set it aside.
Make the sauce. Melt the butter in a saucepan set over medium-high heat. Stir in the flour and cook and stir for 1-2 minutes to eliminate the raw flour taste. Gradually whisk in the milk, stirring until no lumps remain. Add the vegetable broth and simmer the sauce for 3 minutes, or until it starts to coat the back of your spoon.
Add cheese. Stir in the Gruyere cheese and cook until the cheese is melted and the sauce is smooth. Season the sauce with salt and pepper, to taste, add the nutmeg, and remove from the heat. Set aside.
Slice the veggies. Wash and peel the potatoes. Cut the potatoes and onion into 1/8-inch-thick slices.
Assemble. Stack the potatoes in your hand, then place them in the baking dish horizontally so the edges of the potatoes are facing up. Tuck the onion slices between the potatoes.
Add the sauce. Pour the prepared cheese sauce over the potatoes.
Bake. Cover the baking dish with aluminum foil and bake for 1½ hours or until the potatoes are tender.
Finish and serve. Remove the scalloped potatoes from the oven and let them stand for a few minutes. Garnish with fresh thyme and serve.
Notes
Cut the potatoes by hand. The mandolin slicer slices them too thin.
Instead of Gruyere cheese, you can use cheddar or a mix of these two types of cheese.
Use Russet or Yukon Gold potatoes for the recipe. Although they have different moisture levels, both work great as baked potatoes.
For extra flavor, you can add some garlic powder to your sauce.
You can substitute the vegetable broth with milk if you want to use the milk all the way through the sauce.