Preheat oven to 190°C (375°F). Butter a 9x13 inch baking dish. Peel potatoes and slice 3mm (1/8 inch) thin. Toss with 1 tsp salt and set aside.
Melt butter in a saucepan over medium heat. Add garlic and cook 1 minute, stirring. Add flour and whisk for 2 full minutes until the paste smells faintly nutty.
Add milk and cream in a slow stream, whisking constantly. Cook 5-7 minutes over medium-high heat until the sauce thickens enough to coat the back of a spoon.
Remove from heat. Add 1 tsp salt, 1/2 tsp pepper, and nutmeg. Stir in half the Gruyère until melted. Taste and adjust seasoning.
Layer half the potato slices in the dish, overlapping by a third. Scatter half the onion over. Pour half the sauce over and spread to the edges. Repeat with remaining potatoes, onions, and sauce. Top with remaining Gruyère.
Cover tightly with foil. Bake 50 minutes.
Remove foil. Bake uncovered 20-25 minutes until top is deep golden brown and a knife slides through the center without resistance.
Rest uncovered for 15 minutes before slicing. Serve with a wide spatula.