Prep the oven and dish: Heat the oven to 375°F (190°C).
Grease a 9x13-inch baking dish with butter or cooking spray.
Slice the potatoes: Peel and slice the potatoes thinly. Aim for even slices so they cook at the same rate. Pat them dry with a clean towel to remove excess moisture.
Sauté aromatics: In a large saucepan, melt the butter over medium heat.
Add the chopped onion and cook 3–4 minutes until soft. Stir in the garlic and cook 30 seconds until fragrant.
Make the roux: Sprinkle the flour over the onion mixture. Stir constantly for 1 minute to cook off the raw flour taste.
Whisk in dairy: Slowly pour in the milk (and half-and-half if using), whisking to avoid lumps.
Simmer gently, stirring, until the sauce thickens enough to coat a spoon, about 4–6 minutes.
Add flavor: Remove from heat. Whisk in sour cream, Dijon, salt, pepper, paprika, and nutmeg. Stir in 1 cup cheddar and all the Gruyère until melted and smooth.
Taste and adjust seasoning.
Layer the casserole: Spread a thin layer of sauce in the baking dish. Arrange half the potatoes in an even layer. Sprinkle with half the chives.
Pour over half the sauce. Repeat with remaining potatoes, chives, and sauce. Tap the dish gently to settle everything.
Top with cheese: Sprinkle the remaining 1 cup cheddar evenly over the top.
Bake covered, then uncovered: Cover the dish tightly with foil and bake 35–40 minutes.
Remove the foil and bake another 20–25 minutes, until the top is golden and the potatoes are tender when pierced.
Rest and garnish: Let the casserole rest 10–15 minutes to set. Sprinkle with extra chives or parsley before serving.