In a large skillet, melt 4 tablespoons of butter over medium-low heat. Add sliced onions and a pinch of salt. Cook, stirring occasionally, for 45 minutes until deep golden brown and caramelized.
Preheat oven to 375°F (190°C) and grease a 9x13 inch baking dish.
Bring a large pot of salted water to a boil. Cook pasta for 2 minutes less than the package instructions for al dente; drain and set aside.
In a large heavy-bottomed saucepan, melt 3 tablespoons of butter over medium heat. Whisk in the flour and cook for 2 minutes to create a roux.
Slowly whisk in the milk and heavy cream. Simmer, whisking constantly, until the sauce thickens enough to coat the back of a spoon, approximately 8 minutes.
Remove from heat. Stir in 10 oz of Gruyere, the white cheddar, thyme, nutmeg, salt, and pepper until the cheese is completely melted.
Fold the cooked pasta and 75% of the caramelized onions into the cheese sauce until well combined.
Transfer the mixture to the baking dish. Spread the remaining caramelized onions and the remaining 2 oz of Gruyere over the top.
Melt the final 1 tablespoon of butter and toss with panko and crushed fried onions. Sprinkle this mixture evenly over the pasta.
Bake for 20 to 25 minutes until the cheese is bubbling and the crust is golden brown and crispy.