Melt the butter in a skillet over low heat. Add the sliced leeks and cook, covered, until the leeks are tender and lightly colored, about 30 minutes. Stir frequently or the leeks may scorch. Remove from the heat and cool slightly.
Whisk the eggs, yolks, half-and-half, and heavy cream together in a bowl and season with salt and pepper. Add a grating of nutmeg, if you like.
Preheat the oven to 300°F.
Spoon the cooled leek mixture into the partially baked tart shell. Add the cream and egg mixture to fill the tart to within ½ inch of the top. Sprinkle the Gruyère evenly over the tart.
Set the tart on the center rack of the oven and bake until the top is well browned and the filling is completely set, 35 to 45 minutes.
Cool for 10 minutes. Cut into wedges and serve warm.