1. First, cook the potatoes in water, then when they are warm, peel and slice them into rounds. Set aside.
2. Sort, wash, and blanch the spinach in boiling water for 15 minutes. Drain by pressing. Set aside.
3. Peel and finely chop the onion and garlic, then sauté them in butter. Add the spinach and cook until the liquid evaporates. Season with salt, pepper, and nutmeg.
4. In a buttered dish, layer alternately with a layer of potatoes, a layer of spinach, and a layer of grated Gruyère cheese, salt, and pepper. Finish with a layer of potatoes, sprinkle with thyme.
5. Pour the heavy cream over everything and sprinkle with the remaining Gruyère cheese. Place a few hazelnuts of butter on top and bake in the oven for 20 minutes at 200°C (Th 6).