1.
Preheat oven to 190 C / Gas 5.
2.
Line bottom of unbaked pastry case with diced ham and grated cheese.
3.
In a large saucepan, melt butter over medium-low heat. Add onions and cook slowly, stirring occasionally until onions are soft. Spread over ham and cheese in pastry case.
4.
Beat eggs and add salt and nutmeg to taste. Gradually stir in hot milk and heat this mixture over a low flame until it begins to thicken. Pour into pastry case.
5.
Bake in preheated oven for 30 minutes or until custard is set and golden on top. Let cool before slicing.