Fry the bacon in a 12-inch cast iron skillet over medium heat until browned and crisp. Remove with a slotted spoon to a paper towel-lined plate to drain. Pour off all but 2 tablespoons of the bacon grease.
Return the pan to the stove over medium heat and add the onion, cooking until they begin to soften, about 3 minutes. Add the mushrooms and continue to cook until all of the liquid has evaporated and the mushrooms are cooked down, another 5 minutes or so. Add the garlic, thyme, salt and pepper, and cook, stirring frequently, until the garlic is fragrant, another 1 to 2 minutes. Remove from the heat and stir in the cooked bacon; set aside.
In a small saucepan, bring the cream, milk and nutmeg to a simmer over medium-low heat. Remove from heat.
Pour a small amount of the cream mixture into the bottom of a 2-quart baking dish, using just enough to cover the bottom. Layer half of the potatoes over the bottom of the dish, overlapping them as you lay them down. Top the potatoes with half of the bacon and mushroom mixture, then half of the Gruyère. Layer on the remaining potatoes, overlapping them again as needed. Pour the cream mixture evenly over top of the potatoes, ensuring that all of the potatoes are moistened. Top with the rest of the bacon mixture, and then the remaining Gruyère.
Cover the pan with foil and bake until the potatoes are easily pierced with a sharp knife, about 45 to 55 minutes. Remove the foil and return the dish to the oven for an additional 20 minutes, or until the top is golden brown. Let the gratin sit for at least 15 minutes before serving.