Dice garlic and shallots together and spread half the mixture on the bottom of a large shallow pan. Spread half of the salt on top of the mix. Spread half the thyme leaves on the pan as well. Place duck legs, skin side up, on top of this mixture. Spread remaining shallots and garlic, thyme leaves, and salt over the top of the duck legs. Cover with plastic wrap and refrigerate overnight.