flatten_derivations function

Flatten a list of derivations and pipelines