To make the pastry, blitz the flour, walnuts and a pinch of salt in a food processor until combined. Add the butter and pulse until it resembles breadcrumbs. Add the egg yolk and 1 tbsp cold water and pulse until the mixture comes together. Tip out onto a lightly floured board and knead together. Shape into a disc and wrap in clingwrap . Chill for 15 mins.
Preheat the oven to 200°C. Put the onions in a small roasting tin, drizzle with olive oil and roast for 20 mins.
Meanwhile, roll out the chilled pastry to the thin thickness and lightly press into a deep 10in loose-bottom flan tin, trimming away the excess pastry. Chill for 15 mins.
Line the pastry case with baking paper and baking beans. Blind bake for 20 mins, then remove the paper and beans and bake for a further 5 mins until golden and cooked through. Remove and reduce the oven to 180°C.
Whisk the cream, milk, eggs, garlic, mustard and most of the dill in a bowl and season well. Arrange the beetroot and roasted onions in the tart case and pour over the cream and egg mixture. Bake for 30-40 mins until set and golden. Sprinkle with the remaining dill and serve hot or leave to cool completely.