Combine the flour and a pinch of salt in a large bowl.
Add the cold, cubed butter to the flour. Use your fingertips to rub it into the flour until the mixture resembles coarse crumbs.
Gradually add the ice water, one tablespoon at a time, mixing just until the dough comes together.
Form the dough into a disk, wrap it in plastic wrap, and chill for at least 30 minutes.
Preheat the oven to 350°F.
Meanwhile, heat a skillet over medium heat. Add the bacon and cook until crisp, about 5 to 7 minutes. Transfer the bacon to a paper towel–lined plate, reserving the fat in the skillet.
In the same skillet, add the chopped onion and sauté until softened and translucent, about 5 to 7 minutes. Remove from heat.
On a lightly floured surface, roll the dough to about 1/8-inch thickness. Fit it into a 9-inch pie pan, trimming any excess, and prick the bottom several times with a fork.
(Optional) Line the crust with parchment paper and fill it with pie weights or dried beans. Blind-bake for 10 to 15 minutes, then remove the weights and bake for another 5 minutes.
In a medium bowl, whisk together the eggs and heavy cream until smooth.
Stir in the grated cheese, a pinch of nutmeg, salt, and freshly ground black pepper. Fold in the cooked bacon and sautéed onion.
Pour the filling into the crust and bake on the center rack until set in the middle and golden on top, about 30 to 40 minutes.
Let the quiche rest for 10 to 15 minutes before slicing.