I did something similar recently, except that I was stitching a panorama instead of stacking. I’m not sure if this is the ideal way to do this, but it seemed to work well enough.
In Darktable I made a style and export preset to prepare the individual images. The style includes:
- raw black / white point
- white balance set to “camera reference”
- highlight reconstruction if needed
- demosaic
- lens correction if needed
- input color profile set appropriately for camera and working profile linear Rec2020 RGB.
- output color profile set to linear Rec2020 RGB
I export the images as 16 bit linear tiffs, stitch those in Hugin, output a 16 bit tiff, and open that tiff in Darktable and do the rest of the processing. At this point color calibration is added to properly white balance the image.