n a large bowl, mix the flour and salt. Cut in the butter until the mixture resembles coarse crumbs.
Add the egg and just enough cold water to form a smooth dough. Shape into a ball, wrap, and chill for 30 minutes.
While the dough chills, melt the butter in a skillet over medium heat. Add onions and cook, stirring often, until golden and caramelized, about 20 minutes.
In a separate bowl, whisk together cream and eggs. Stir in grated cheese, salt, pepper, and nutmeg.
Roll out the dough on a floured surface and fit into a 9-inch tart pan. Trim edges. Prick the bottom with a fork. Line with parchment and fill with pie weights. Bake at 350°F for 10 minutes.
Remove parchment and weights. Spread caramelized onions over the crust, then pour the cream mixture on top.
Return to the oven and bake 25–30 minutes, until the filling is golden and set.
Let cool slightly before slicing. Serve warm or at room temperature.