1. To make the dough, stir the flours together. Add the butter and rub it with your fingertips until it resembles coarse bread crumbs. Stir in enough of the water until the dough holds together. Shape into a thick disk, wrap in plastic wrap, and refrigerate for 30 minutes.
2. On a lightly floured surface, roll the dough into a 1/8 in (3mm) round circle and use to line a 9in (23cm) tart pan with a removable bottom. Prick it lightly all over with a fork. Chill for 30 minutes.
3. Preheat the oven to 400°F (200°C). Line the dough with parchment paper and fill with baking beans. Bake for 10 minutes. Remove the paper and beans and bake for 10 minutes more, until the crust is golden and crisp. Remove from the oven. Reduce the oven temperature to 375°F (190°C).
4. Meanwhile, to make the filling, heat the butter and oil in a large frying pan. Add the onion and cook over low heat, stirring frequently for 15 minutes, until tender. Stir in the sugar and nutmeg and cook for about 3 minutes more, until golden. Transfer to a plate and cool.
5. Stir half the Gruyére into the cooled onion mixture, then spread in the pastry shell. Sprinkle with the remaining cheese. Whisk the half-and-half, eggs, and mustard together and season with salt and pepper. Pour into the shell. Bake for 30 minutes, until lightly set.
6. Let cool on a wire rack for 10 minutes. Remove the sides of the pan and serve warm or cooled.
Roquefort and Walnut Tart: Add ½ cup toasted and very finely chopped walnuts to the flour in the pastry dough. Substitute 2 leeks, white and pale green parts, finely sliced, for the onion, and Roquefort for the Gruyere.