1. Sift the flour into a large bowl. Add the butter and rub it in until the mixture resembles fine breadcrumbs. Make a well in the centre, add the egg yolk and 2 tbsp ice-cold water. Using a palette knife, bring the mixture together until you have a ball of soft dough. Knead briefly to combine and make smooth. Wrap in clingfilm and chill for 30 minutes.
2. Divide the pastry into 4 equal pieces. On a surface lightly dusted with flour, roll out the pastry to circles large enough to cover the base and sides of 4 x 10cm, 3cm deep, loose-based tart tins. Carefully press the pastry into the tins and trim the edges. Prick each pastry case well with a fork. Chill for at least 10 minutes.
3. Meanwhile, preheat the oven to 190°C/Fan 170°C/Gas 5. Place a baking sheet in the oven.
4. Scrunch up 4 pieces of greaseproof paper, un-scrunch and place one in each pastry case. Fill with baking beans. Place the tins on the baking sheet and cook for 10 minutes. Carefully remove the paper and beans and cook for 10 minutes or until the pastry is crisp and golden.
5. Meanwhile, heat the oil in a wok or large frying pan. Add the shallots or baby onions and cook, stirring regularly, for 5 minutes or until beginning to soften. Add the remaining veg and stir-fry for 8-10 minutes or until tender. Season with salt and freshly ground black pepper, add the lemon rind and nutmeg, and cook for 12 minutes. Add the lentils and nuts, and mix well.
6. Spoon the veg into the hot pastry cases and scatter with thyme leaves. Serve straight away.