01 - Preheat oven to 375°F. Grease a 9x13 inch baking dish with butter, ensuring even coverage across the bottom and sides.
02 - Arrange half of the sliced potatoes in the prepared dish, overlapping them slightly. Scatter half the onions, half the minced garlic, 1 teaspoon of nigella seeds, and half the salt, pepper, and nutmeg over the potatoes.
03 - Layer the remaining potatoes and onions on top. Season with the remaining garlic, nigella seeds, salt, pepper, and nutmeg, distributing evenly.
04 - Whisk the heavy cream and whole milk together in a bowl, then pour the mixture evenly over the layered potatoes. Dot the surface with small pieces of the unsalted butter.
05 - Cover the dish tightly with aluminum foil and bake for 40 minutes, allowing the potatoes to soften and absorb the cream.
06 - Remove the foil and sprinkle the grated Gruyère cheese evenly over the top. Return to the oven uncovered for an additional 20 minutes until the cheese is golden brown and the gratin is bubbling.
07 - Remove from the oven and let the gratin rest for 10 minutes before serving. This allows the layers to set and makes for cleaner portions.