Make Cheese Sauce:
In a medium sauce pan, melt butter over medium heat. Add flour and whisk well to ensure all the flour is incorporated into the fat, cook while whisking for 1-2 minutes. Add milk and half and half gradually, slowly adding the liquid while whisking vigorously so there are no lumps in the pot. Add thyme, onion, and garlic and whisk in well. Let sauce simmer and bubble for 3-5 minutes, whisking occasionally, until thick enough to coat the back of a spoon.
Take pot off the heat and add 1 cup of gruyere cheese. Whisk in well until the cheese is melted. Add in salt to taste, and the other seasonings. Taste and adjust accordingly.
To Bake:
Preheat oven to 350 degrees F.
Using a mandoline or very sharp chef knife, slice the potatoes extremely thin, about ⅛ inch or less.
Layer the potatoes in a 9x13 inch oven safe dish, pour on about ⅓ cup cheese sauce, then cover evenly with a handful of cheddar and gruyere cheese. Repeat until you've reached almost the top of your baking dish, about 3-4 layers ending with the last bit of cheese sauce. Cover the top with the last of your cheese, a hearty amount evenly sprinkled over top.
Bake in the oven for 45 minutes to one hour.
Let cool for five minutes before serving.