melt the butter in a large saucepan over medium heat. Add the onions, salt, pepper, and nutmeg. cover and cook until the onions are just tender, about 10 minutes. transfer to the pastry shell and mix gently with the gruyere. Whisk together the cream and egg yolks and pour over the onion mixture. Bake for 25 to 35 minutes until the custard is set.