Peel the onions. Clean and wash the leek. Cut both into fine rings. Cut bacon into small cubes. Wash and chop thyme.
Peel garlic and press through a garlic press. Heat olive oil in a large casserole. Leave out the bacon. Add onions, leek, garlic and thyme and fry. Deglaze with stock and white wine, bring to the boil and simmer covered for about 20 minutes. In the meantime, cut or grate cheese into fine slices. Cut baguette into about 12 slices. Season soup with salt, pepper and sugar. Pour soup into ovenproof soup bowls. Put slices of bread on top of the soup.
Cut baguette into about 12 slices. Season soup with salt, pepper and sugar. Pour soup into ovenproof soup bowls. Put slices of bread on top of the soup. Spread cheese on top. Bake in the preheated oven (electric cooker: 175 °C/ convection oven: 150 °C/ gas: level 2) for approx. 12 minutes. Serve garnished with thyme