Preheat the oven to 200 degrees Celsius (392 degrees Fahrenheit).
Put leeks, squash, potatoes, and ham in an ovenproof dish.
Whisk milk, cream, eggs, Parmesan, salt, pepper, and chives together and pour into the dish.
Sprinkle with grated cheese and bake for 30 minutes in the oven.
Meanwhile, fry the bacon until crispy in a pan.
Sprinkle the bacon over the finished dish and serve.