Spread nuts on a baking sheet and lightly toast in the preheated oven. Turn the nuts frequently so that they do not burn.
Allow to cool and chop finely. Sauté onions and garlic in oil until light (do not brown), add remaining ingredients (except schnapps or liqueur and alcohol) and bring to a boil.
Cover and cook gently for about 20 minutes, stirring frequently. If necessary, add nut schnapps or herb liqueur to taste.
Immediately pour the jam into preheated, prepared jars and press down well with a spoon so that any air bubbles can escape. Using an eyedropper, drizzle a few drops of alcohol over the top, light and seal immediately.