01 - Preheat the oven to 375°F. Grease a 9x13 inch baking dish generously with butter, ensuring all surfaces are coated to prevent sticking.
02 - Arrange half of the sliced potatoes in the prepared baking dish, overlapping them slightly in even rows. Scatter half of the sliced onions over the potatoes, then distribute half of the minced garlic, 1 teaspoon of nigella seeds, and half of the salt, pepper, and nutmeg evenly across the layer.
03 - Layer the remaining potatoes and onions over the first layer. Season with the remaining garlic, nigella seeds, salt, pepper, and nutmeg, distributing the spices uniformly for balanced flavor throughout.
04 - Whisk together the heavy cream and whole milk in a bowl until combined. Pour the mixture slowly and evenly over the layered potatoes, allowing it to seep down between the slices. Dot the surface with small pieces of the unsalted butter.
05 - Cover the baking dish tightly with aluminum foil and place in the center of the oven. Bake for 40 minutes until the potatoes are nearly tender when pierced with a knife.
06 - Remove the foil and sprinkle the grated Gruyère cheese evenly over the top. Return the dish to the oven uncovered and bake for an additional 20 minutes until the cheese is deeply golden and the cream is bubbling around the edges.
07 - Remove from the oven and allow the gratin to rest for 10 minutes before serving. This resting period lets the cream sauce thicken and set, making it easier to portion into clean slices.