Pre heat a fan forced oven to 180℃
Pour oil into a frying pan over medium heat, then add diced onion and fry for a couple of minutes until onion is opaque but not browned. Add bacon to the pan and continue to fry for about 3 more minutes. Remove onion and bacon from the pan onto a plate lined with paper towel (this will soak up any excess oil) and set aside.
Grease the pie dish with the butter and then dust with flour (this will ensure the pastry does not stick to the dish). Place the sheet of puff pasty into your pie dish and trim off any excess pastry and use it to fill in any gaps. Put a piece of baking paper over the pastry and then use your baking beads to weigh it down evenly.
Place the pie dish with pastry into the oven and bake for 10 minutes. This step of blind baking the pastry will ensure you don't have a soggy pie bottom.
While the pastry is in the oven make your egg mixture. Place eggs, milk and nutmeg into a bowl and whisk gently until well combined.
Take the pastry out of the oven and remove the baking paper and baking beads. Now its time to fill the pie.
Layer bacon and onions, then cheese into the pie dish and then pour in the egg mixture. Bake for 40 minutes until set and golden on the top. Rest the pie for 10 minutes before serving (don't worry it will retain its heat).