Coarsely grind the walnuts. Mix flour, nuts, sugar and 1/2 tsp. salt in a bowl. Add butter in flakes and 1 egg, and knead everything quickly with your hands to a smooth dough. Grease a springform pan (24 cm Ø).
Roll out the dough on a floured work surface until round (approx. 30 cm Ø). Line a mould with it, press the dough on the bottom and the edges. Put it in a cold place.
Clean the mushrooms and cut them in half. Clean, wash and cut spring onions into rings. Sort the spinach, wash and drain well. Heat the oil in a large pan and fry the mushrooms well.
Add the onion and fry briefly. Add the spinach and let it collapse. Season with salt and pepper. Place in a sieve and drain.
Mix crème fraîche with 4 eggs until smooth, season with salt, pepper and nutmeg. Cut cheese into cubes, cut ham into strips. Spread mushroom mixture, ham and cheese on the dough. Pour egg icing on top.
Bake in the preheated oven (electric cooker: 200 °C/ convection oven: 175 °C/ gas: see manufacturer) on the lower rack for 35-40 minutes. Wash chives, shake dry and cut into thin rolls.
Remove the mushroom cake from the oven, arrange, cut into pieces, garnish with sour cream and nuts if necessary and sprinkle with chives.