In a bowl, mix together coffee, chili powder, brown sugar, paprika, 1 tbsp salt, cumin, and red pepper flakes. Rub the pork shanks thoroughly with the spice mixture. You may have some left over, store it in an airtight container for future use.
In a large, heavy bottomed pot or dutch oven, melt ghee over medium high heat. Once melted, sear the pork shanks on all sides until deep brown. Remove to plate.
Reduce the heat to low and add onions, carrots, and garlic to the pot and cook until onions have started to soften.
Deglaze the dutch oven with beer. Stir and scrape any stuck on bits from the bottom to the pot until loosened.
If cooking in the Instant Pot or slow cooker, transfer liquid and veggies to that container. Add stock, bay leaves, salt, and dried herb blend to your vessel of choice and stir to combine. Return pork shanks to liquid.
If cooking in the Instant Pot, cook using the manual setting for 90 minutes and use a manual release when done. If cooking stove top, cook for 3-5 hours, turning the shanks every hour or so, until fall apart tender. If cooking in the slow cooker, cook for 8-10 hours, turning the shanks every hour or so, until fall apart tender.
To serve, remove shanks to a cutting board and pull the meat from the bone. Serve with braising liquid spooned over the top.