Heat oil in a stockpot or Dutch oven over medium heat. Add onions and cook 10 minutes, stirring occasionally, or until softened and starting to brown. Stir in shallot and mushrooms and cook 5 minutes, or until the mushrooms turn dark brown.
Pour in broth and water and stir in rosemary sprigs. Cover, bring to a boil, and then reduce heat to low and simmer 10 minutes, or until the onions are fully cooked and the flavors meld together. Season with salt and pepper to taste.
In the meantime, preheat the broiler and spread baguette slices on a rimmed baking sheet. Transfer baking sheet to the oven and toast bread 2 minutes on each side, or until golden brown. Remove from the oven and set aside. (Leave the broiler on because you will use it again.)
Arrange 4 oven-safe soup crocks on the baking sheet. Divide the soup between the crocks. Place a piece of toasted baguette and slice of Gruyere cheese on top of each. Carefully return the baking sheet with the soup crocks to the oven and broil 2 minutes, or until the cheese is melted. Remove from the oven, garnish with fresh thyme leaves if desired, and allow to cool slightly before serving. (The soup crocks will be very hot. Serve on plates if desired.)
Store leftover soup in an airtight container and refrigerate up to 4 days or freeze up to 3 months. Toast bread and melt cheese immediately before serving.
Gruyere cheese can be made with animal rennet but some brands (such as Boar’s Head) make vegetarian versions. If you can’t find suitable Gruyere cheese, substitute swiss, provolone, or mozzarella.
Vegan/dairy-free variation: Omit cheese or substitute dairy-free cheese slices.
Gluten-free variation: Omit bread or substitute sliced gluten-free bread.
If you don't have oven-safe soup crocks, melt the cheese on top of the soup in the microwave for about 20 seconds instead of broiling.
This recipe originally appeared on GratefulGrazer.com.