Melt the butter in a saucepan over medium heat, stir in the flour for 1 minute and whisk in the milk gradually.
Add the salt, pepper and nutmeg and simmer for 4 minutes until the sauce lightly coats a spoon.
Layer half the potatoes and onion in a buttered 9-by-13-inch baking dish, pour over half the sauce and repeat.
Cover tightly with foil and bake at 375°F for 50 minutes.
Uncover and bake for 20 to 25 minutes until the potatoes yield easily to a knife and the top is browned; rest for 15 minutes before serving.