Preheat the oven to 400°F and position a rack in the middle. Thaw the pie crust slightly and prick it with a fork. Blind bake on a sheet until golden, about 10-15 minutes, then reduce oven temperature to 325°F.
Cook the bacon in a pan until crisp, then transfer to a paper towel. Sauté the shallots in the remaining bacon fat until soft and translucent.
Whisk together eggs, heavy cream, salt, cayenne pepper, and nutmeg in a bowl.
Layer the shallots, half the bacon, Gruyère cheese, and remaining bacon in the crust. Pour the egg mixture over the top.