Shred your cheese and beat eggs with about 2/3 of your chosen heavy cream. If you want to add a dash of your chosen wine at this point, why not. Can add salt and pepper as well as any other spices to taste. I Will add the nutmeg here as I find it does wonderful things to the cream while it sits and comes up to room temperature as your onions sweat.
You're going to need to sweat down your leeks and onions with your choice of wine, your choice of fat (butter, neutral oil or olive oil). I tend to do a medium chop on both. You want them small enough to cook in a good time over medium heat, but not so small that they burn too quickly. You could also cut the onions like you were going to caramelize them and then caramelize the onions first. Add the leeks later if you wanted to go with a sort of richer darker take.
I often add the stock mixed with about half a cup of liquid and the wine throughout the process to sort of encourage the onions to sweat covered and to get the flavors of the onion and stock merged. If you're adding the stock dry which you can do, I would say near the end when you add the wine to cook the alcohol down and get the flavors into the onion. If you add all the wine at the beginning it kind of gets lost a little bit in my opinion.
Once the onions have sweat down and are translucent use a splash of wine to deglaze if needed and then reduce the heat down to simmer or take it off the heat if you use an enamel pan that will hold the heat and slowly add about a third of the cream as the temperature gets low enough to incorporate and not scald it.
Once a third of the total cream is incorporated nicely slowly add the onion mixture to the beaten egg/cream mixture and about half of the cheese. You want it just warm enough that your cheese stretches a little bit as it mixes but not so warm that it tempers the egg.
Add mixture to your pie crust and add the rest of the shredded cheese on top if you need more cheese to fill out the pie crust, this is the time to do it.
Bake until firm and golden, we usually do about 30 to 45 minutes out of 350 oven about as long as it's set up and the egg is fully cooked, you should be fine.
It's often best the next day reheated, but if you want to eat it the same night as you cooked it, I would let it rest for 20 to 30 minutes before cutting. It'll let it firm up