1 prepared 9 inch pie crust
4 tablespoons butter
4 onions, peeled and sliced thin
1 1/2 cups half-and-half
2 egg yolks
1/2 cup grated Gruy?re cheese
Pinch cayenne pepper
Roll the chilled pie dough into a 12-inch round. Line a 9-inch pie pan with the dough, folding the edges in to make double-thick sides. Press the sides in well and prick the bottom all over with a fork. Refrigerate for at least 1 hour.
Preheat the oven to 375?. To keep the dough from shrinking while it bakes, line the shell with a piece of foil or parchment paper, then fill the tart with a layer of dried beans or other pie weights. Bake for 15 minutes, or until lightly golden around the edge. Take the tart out of the oven; remove the foil and the weights. Return to the oven and cook for another 5 to 7 minutes, until the pastry is an even light golden brown. (I went for 10 more minutes here and think it would have been fine to go even a bit longer.)
In a heavy bottomed skillet, melt the butter over a medium flame. Then add the onions and cook until soft and golden, 20 to 30 minutes. Season with salt and pepper. Taste to make sure the onions are already delicious by themselves. Cool.
Mix together the remaining ingredients. When the onions are cool, spread them in the baked tart shell, pour in the custard mixture, and bake at 375 for 35 to 40 minutes, until the top is puffed and golden brown. Let the pie sit at room temperature for 10 minutes or so to firm up before you cut into it.