01 - Preheat the oven to 350°F. Grease a 9x13-inch baking dish with butter or nonstick spray.
02 - In a medium saucepan over medium heat, melt the butter. Add the onion and sauté until soft and translucent, about 3 to 4 minutes.
03 - Stir in the flour and cook for 1 minute, stirring constantly to form a roux.
04 - Gradually whisk in the milk and cream. Continue cooking and stirring until the sauce thickens, approximately 5 minutes.
05 - Remove from heat and stir in Dijon mustard, salt, pepper, nutmeg, then fold in the shredded cheddar and Gruyère until melted and smooth.
06 - Arrange half of the sliced potatoes evenly in the prepared dish, pour half of the cheese sauce over, then layer the remaining potatoes and cover with the rest of the sauce.
07 - Sprinkle the remaining cheddar and Gruyère cheeses evenly on top.
08 - Cover the dish with foil and bake for 40 minutes.
09 - Remove foil and bake an additional 20 minutes until the top is golden and the potatoes are tender when pierced.
10 - Let stand for 10 to 15 minutes before serving. Garnish with chives or parsley if desired.