In the bowl of a food processor, combine flour, salt, pepper, and thyme leaves.
Add egg yolk and chilled butter cubes, and pulse in 1-second bursts until the mixture resembles grains of rice (8-10 pulses).
Add the ice water 1 tbsp at a time and pulse until the mixture just comes together.
Pour the mixture out onto a clean surface and bring together with your hands, adding ice water as necessary. Gather all the crumbs and form into a rough ball. Do not knead or over-mix; only do enough to get the mixture to hold together.
Form the dough into a disc, wrap in plastic, and refrigerate for one hour (or up to 2 days).
After dough has chilled, place on a lightly-floured surface and roll thinly until the disc is 2-3 inches larger than your tart pan. Gently place the dough into the tart pan and press the bottom and sides in, then pierce the bottom a few times with a fork. Cover in parchment paper and fill with pie weights or dried beans.
Bake in 400-degree oven for 20-25 minutes, until the sides are dry and flaky but not browned. Remove the weights and parchment and cook 5-10 more minutes, until the bottom crust is dry.
Make the filling
Reduce the oven heat to 375.
Cook the bacon in a large skillet over medium-high heat and remove. Leave the bacon fat in the pan.
Add leeks and thyme and cook until leeks are soft but not browned, approximately 5 minutes. Remove from heat.
Once the leeks are cooled, add bacon and gruyere and combine. Reserve a small handful of the bacon.
To make the custard, in a separate bowl, combine eggs, egg yolk, milk, cream, nutmeg, and a pinch of salt and pepper. Mix well to combine.
Assemble and cook
Add the leek-bacon mixture to the prepared crust. Pour the custard over the mixture, making sure not to overfill the pan. Stop when the mixture almost reaches the top, but leave a bit of room for the custard to expand when cooked.
Bake at 375 for 30-40 minutes, until the cheese is melted, the egg is cooked, and the top of the tart is golden brown. Let stand for at least 15 minutes before slicing.