01 - Preheat oven to 375°F. Generously grease a 9x13 inch baking dish with butter.
02 - Arrange half the sliced potatoes in the prepared dish, overlapping slightly. Scatter half the onions, half the garlic, 1 tsp nigella seeds, and half the salt, pepper, and nutmeg evenly 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 butter.
05 - Cover the dish tightly with aluminum foil and bake for 40 minutes until the potatoes are nearly tender when pierced with a knife.
06 - Remove the foil and sprinkle the Gruyère cheese evenly across the top. Return to the oven uncovered for an additional 20 minutes until the cheese is golden brown and the cream is bubbling.
07 - Allow the gratin to rest for 10 minutes before serving so the layers set and the dish holds its shape when portioned.