To make the pastry, blitz the walnuts in a food processor until they resemble breadcrumbs. Add the flour and a large pinch of salt. Pulse briefly to combine, then add the butter and pulse until it resembles large crumbs. Add the egg yolk and pulse until the dough comes together (add 1 tbsp cold water if it seems dry). Squash the dough into a disc, then wrap in baking parchment and chill for at least 30 mins.
Heat the oven to 180C/160C fan/ gas 5. Heat the butter and 1 tbsp oil in a heavy-based frying pan or skillet over a medium heat, and cook the shallots, sage and chard stalks for 5-8 mins until soft and starting to caramelise. Add the chard leaves and continue to cook until wilted, then remove from the heat.
Put the chilled pastry between two sheets of baking parchment and roll out to the thickness of a £1 coin. Use it to line a 20cm tart tin, then chill for 30 mins until firm. Toss the pear slices in 1-2 tsp oil on a baking sheet.
Scrunch up a sheet of baking parchment and use it to line the pastry case, then fill with baking beans. Bake for 15 mins, alongside the pears. Remove both from the oven. Remove the parchment and beans from the pastry case, then bake for 8-10 mins more, until the bottom is golden and crisp.
Lightly beat the eggs in a bowl, then season with some nutmeg and whisk in the crème fraîche. Stir in the cheese. Pour half the mixture into the tart case, then layer in two-thirds of the chard mixture. Arrange the roasted pear slices and remaining chard mix on top, then pour over the remaining custard. Dot over the walnut halves, then bake for 28-30 mins, or until golden and cooked through. Leave to cool for 20 mins, then slice and serve.