Sprinkle half the salt and a few grinds of pepper and scatter half the garlic, shallots, and thyme in a pot just large enough to hold the duck legs in a single layer. Add the duck legs and sprinkle with remaining salt, a few grinds a pepper, and remaining garlic, shallots, and thyme. Cover and refrigerate a day or two.
Adjust oven rack to lower-middle position and heat oven to 225 degrees. Pour duck fat over duck legs, cover and cook until duck is fall-off-the-bone tender, 2 to 3 hours. (Duck can be refrigerated in fat for several weeks.) When ready to make cassoulet, warm duck enough to melt fat. Remove duck legs from fat, separating duck meat from bones. Discard bones, save duck fat for another use, and use duck confit to make A Simpler Cassoulet.
Recipe by Three Many Cooks at https://threemanycooks.com/recipes/meaty-mains/classic-cassoulet-with-from-scratch-duck-confit/