Butter an 8-by-8-inch square flameproof casserole dish. Halve the leeks lengthwise, and then cut them crosswise into half circles (There should be about 1 3/4 cups.). Put the cut leeks in the basket of a salad spinner, or a colander set in a bowl, and fill with water. Swish the leeks around to flush out any grit. Lift the basket from water--don't pour the water off or you will pour any grit right back over the leeks.
Heat a medium skillet over medium heat and fry the bacon until crispy, about 5 minutes. Transfer the bacon to a paper towel-lined plate to cool, then crumble. Discard all but 1 tablespoon of the pan drippings, add the butter and leeks, and season with 1/2 teaspoon salt and some pepper. Cook until tender, about 10 minutes.
Meanwhile, put the potatoes in a small saucepan with the garlic, thyme, and 1 1/2 teaspoons of salt and water, to cover. Bring to a boil over high heat, then drain. Discard the thyme and garlic and add potatoes to the leeks.
In a medium bowl whisk together the eggs and half-and-half, then stir in the leek mixture, 1 cup of the cheese, the bacon, and nutmeg. Season with 1 teaspoon of salt and some pepper. Transfer the mixture to the prepared dish, cover with foil and bake until just set but still moist, about 55 minutes. Remove from the oven and set aside.
Position a rack in the upper part of the oven and preheat the broiler. Scatter the remaining 1 cup cheese over the casserole and broil until the cheese browns, about 3 minutes. Set aside for 5 to 10 minutes before serving. Unmold or serve from baking dish.