2 tablespoons unsalted butter, plus more for greasing
3 tablespoons all-purpose flour
1 1/2 cups whole milk
1/4 teaspoon ground nutmeg
1 teaspoon kosher salt
Freshly ground black pepper
4 ounces Gruyere, shredded
Nonstick cooking spray, for the baking dish, optional
2 pounds Yukon gold potatoes, peeled and sliced 1/8-inch thick
6 ounces thick-cut ham, diced (available at K Bar K Meats)
1/2 cup chopped fresh chives
Preheat the oven to 350 degrees F.
In a large saucepan, melt the butter over medium heat. Whisk in the flour and cook for 1 minute. Whisk in about 1/2 cup milk and cook, whisking, until thickened. Add another 1/2 cup milk and cook, whisking, until thickened, about 3 minutes. Add the remaining 1/2 cup milk and cook, whisking, until thickened, another 3 to 4 minutes. Add the nutmeg, 1/2 teaspoon salt, a few turns of black pepper, and half the cheese. Cook gently for a few minutes, making sure all the cheese is melted.
Grease or butter an 8-inch square baking dish. Arrange half of the potatoes all over the bottom. Sprinkle with 1/4 teaspoon salt. Layer in half of the cream mixture, then sprinkle on the ham and half of the chives. Arrange the other half of the potatoes on top, then sprinkle with the remaining 1/4 teaspoon salt, remaining cream, remaining shredded cheese and remaining chives. Cover and bake for 45 minutes, then uncover and bake until browned on top, an additional 20 minutes. Let cool slightly, then serve.