When stackage2nix is used alongside stack, it is likely that the local packages contain a .stack-work/ folder. Those can quickly grow in size, and when putting the src of the derivation in the store Nix will first try to load up the whole directory in memory. With 6GB+ stack-work/ dirs this quickly becomes a problem.
One solution would be to use cleanSources or builtins.filterSource directly when generating the nix code, assuming that users will never want to have the stack-work/ directories in their nix store. Another solution would be to allow passing a custom filter, potentially operating on the package name for greater flexibility.
When
stackage2nixis used alongsidestack, it is likely that the local packages contain a.stack-work/folder. Those can quickly grow in size, and when putting thesrcof the derivation in the store Nix will first try to load up the whole directory in memory. With 6GB+stack-work/dirs this quickly becomes a problem.One solution would be to use
cleanSourcesorbuiltins.filterSourcedirectly when generating the nix code, assuming that users will never want to have thestack-work/directories in their nix store. Another solution would be to allow passing a custom filter, potentially operating on the package name for greater flexibility.