01 - Preheat the oven to 375°F. Rub a large baking dish with the cut sides of the garlic clove, then butter it with 1 tbsp butter.
02 - Arrange half the sliced potatoes in the dish, overlapping slightly. Top with half the onions (if using), and season with salt, pepper, and nutmeg.
03 - Sprinkle half the grated Gruyère over the potatoes.
04 - Repeat layers with remaining potatoes, onions, seasoning, and cheese, finishing with the cheese on top.
05 - In a saucepan, gently heat cream and milk until just steaming but not boiling. Pour evenly over the potatoes. Dot with the remaining 1 tbsp butter.
06 - Cover the dish with foil and bake for 40 minutes.
07 - Remove the foil, bake uncovered for an additional 20 minutes, or until the potatoes are tender and the top is golden and bubbling.
08 - Allow to rest for 10 minutes before serving. Garnish with chopped chives or parsley if desired.