Add support for deriving modules in place