Peel and wash the potatoes and onions. Cut the potatoes into thin slices and the onion into half rings.
Grease a baking dish with butter. Place alternating layers of potatoes and onions into the pan, salting them.
Melt the butter in a frying pan, add flour, mix well and lightly fry. Pour in the milk, add nutmeg, salt and pepper and cook until thickened for 3-4 minutes, stirring constantly.
Pour the prepared sauce over the potatoes and onions, sprinkle grated cheese on top and bake in an oven preheated to 200 °C for 40 minutes until golden brown. Cool the casserole and serve cut into portions.
When serving, sprinkle with finely chopped herbs.