For the pastry, tip the flour and butter into a bowl with a pinch of salt. Rub the mixture together with your fingertips until it resembles coarse breadcrumbs. Stir in the walnuts and paprika.
Slowly add enough of the beaten egg to bind the mixture (you may not need all of it). Knead the pastry briefly until smooth, flatten into a disc, wrap in cling film and chill in the fridge for 30 minutes.
Preheat the oven to 180C/350F/Gas 4.
Roll the pastry out between two sheets of cling film, remove the cling film and use the pastry to line a 25cm/10in tart tin.
Line the pastry with greaseproof paper, fill with baking beans and bake for 10-15 minutes. Remove the baking beans and greaseproof paper and bake for a further five minutes, or until pale golden-brown.
Meanwhile, for the filling, wilt the spinach in a saucepan with a little water. Set aside to cool, then squeeze out the excess water and chop finely.
Cook the potatoes in boiling water for 10 minutes, or until just cooked, then cool and slice into 0.5cm/¼in slices.
Whisk the eggs in a bowl, then whisk in the cream, lemon zest, nutmeg, cayenne and parmesan. Season well with salt and freshly ground black pepper, then stir in the spinach and half of the thyme.
Arrange the potato slices in the bottom of the pastry case and sprinkle over the Stilton. Spoon in the spinach mixture and sprinkle over the remaining thyme.
Bake in the oven for 35-40 minutes, or until golden-brown and just set. Remove from the oven and set aside to cool for 10 minutes.