Preheat oven to 325°F. Rub cut sides of garlic all over inside of a 2 1/2- to 3-quart oval broiler-safe baking dish; discard garlic. Rub inside of dish with 1 tablespoon butter; set aside.
Arrange potato and onion slices, standing slightly vertically on edges, in slightly overlapping concentric circles in the baking dish. Tuck smaller potato and onion slices into any gaps in dish to fill. Cover with a damp paper towel until ready to use.
Heat remaining 2 tablespoons butter in a medium saucepan over medium until melted and foaming. Add flour; cook, whisking constantly, for 1 minute. Slowly whisk in cream until smooth. Whisk in salt, mustard, and nutmeg. Bring to a simmer over medium, whisking constantly. Remove from heat. Whisk in 3/4 cup of the Cheddar and 1/2 cup of the Gruyère, 1 handful at a time, until melted and smooth. Pour evenly over potato mixture. Sprinkle with remaining 3/4 cup Cheddar and 1/2 cup Gruyère.
Cover baking dish with aluminum foil. Bake in preheated oven until cream is bubbling, cheese has melted, and potatoes are tender when pierced with a fork, 1 hour to 1 hour, 15 minutes. Carefully remove foil from baking dish, while keeping dish in oven. Increase oven temperature to broil. Broil gratin until cheese is bubbly and browned in spots, checking occasionally to prevent over-browning, 5 to 8 minutes. Remove from oven. Let stand 20 minutes. Sprinkle with chives and serve.