01 - Combine flour and salt in a large bowl. Cut in cold butter until mixture resembles coarse crumbs. Add egg and enough cold water to form a soft dough. Shape into a disk, wrap, and refrigerate for 30 minutes.
02 - Preheat oven to 375°F. Roll out dough on floured surface to fit a 9-inch tart or pie pan. Press into pan, trim edges, and prick base with fork. Chill until ready to fill.
03 - Melt butter in large skillet over medium heat. Add bacon and cook until just crisp. Remove and set aside. Add onions to pan and cook gently, stirring often, for 15-20 minutes until golden and very soft. Stir in caraway seeds, salt, pepper, and nutmeg. Remove from heat and mix in bacon.
04 - Whisk together cream, milk, eggs, and cheese until smooth in a bowl.
05 - Spread onion mixture evenly over prepared crust. Pour custard over the onions.
06 - Bake for 40-45 minutes until filling is set and lightly golden. Let cool for 10 minutes before slicing.
07 - Serve warm or at room temperature with a crisp German white wine like Riesling or a green salad on the side.