Preheat your oven to 375°F (190°C).
In a large skillet, heat the olive oil over medium heat. Add the sliced leeks and onion, and sauté for about 5-7 minutes until they are soft and translucent. Season with salt, pepper, and nutmeg. Remove from heat and let cool slightly.
In a mixing bowl, whisk together the heavy cream and eggs until well combined. Stir in the grated Gruyère cheese.
Add the sautéed leeks and onions to the egg mixture, stirring gently to combine.
Place the pie crust in a 9-inch tart pan or pie dish. Pour the leek and cheese mixture into the crust, spreading it evenly.
Bake in the preheated oven for 30-35 minutes, or until the tart is set and lightly golden on top.
Remove from the oven and let cool for about 10 minutes before slicing. Garnish with fresh thyme leaves if desired.