Preheat the oven to 350F.
Cook the pasta according to package directions until al dente. Reserve some pasta water, then drain.
Heat butter in a large skillet over medium heat. Add the onions and cook slowly, stirring often, until deeply caramelized. This may take a full hour so be patient!This step can take awhile so be patient!
Add garlic and coconut aminos in the last two minutes and stir.
Add in the flour and stir to coat the onion mixture.
Pour in the heavy cream little by little, stirring to mix in each addition before adding more. Repeat with the broth, then add half of the gruyere cheese. Note that if you're using 16 oz. of pasta, simply use more broth.
Add the cooked pasta and chopped sausage, and toss to coat, using reserved pasta water if needed. Season with the thyme, salt, and pepper.
Transfer everything to a baking dish and top with the remaining cheese.
Bake for about 15-20 minutes, until the cheese is completely melted and everything is hot. Optionally, broil the casserole for the final 2 minutes to crisp the cheese.