500g (1-pound) day-old sourdough boule, cut into 1-inch cubes
4 large eggs
850ml (3.5 cups) whole milk, or any combination of milk and cream
1/2 teaspoon ground nutmeg
1/2 teaspoon kosher salt
1/4 teaspoon freshly ground black pepper
butter
150g (1 cup) caramelized onions
150g (1.5 cups) shredded mild cheese, divided
225g (8oz) thick-cut ham, cut into 1/2-inch cubes
2 tablespoons thinly sliced fresh chives, for garnish
Beat the eggs in a large bowl, and whisk in the milk (and cream, if using), nutmeg, salt, and pepper.
Add the bread cubes to a gallon-sized resealable bag, then pour in the custard. Press out any air and seal the bag. Rotate the bag a few times so the bread begins to soak up the custard. Refrigerate for at least 3 hours and up to overnight, turning the bag periodically so the bread evenly soaks up the custard.
Arrange a rack in the middle of the oven and heat to 375°F. Generously coat a 9-inch springform pan with butter or cooking spray.
Pour the bread mixture into a large bowl. Add the onions, 1 cup of the cheese, and ham and stir to combine. Transfer to the prepared baking pan. Use your fingers to press down and lightly compress the bread. Sprinkle with the remaining cheese.
Bake uncovered until the center is set and the top is golden-brown, 50 to 55 minutes. Let cool for at least 10 minutes before serving. Top with the chives and serve warm or at room temperature.