fix: storage error
1 file changed, 9 insertions(+), 1 deletion(-)
changed files
M internal/importer/importer.go → internal/importer/importer.go
@@ -21,10 +21,18 @@ func (imp *Importer) indexSource( ctx context.Context, source *config.Source, ) (bool, error) { + var exporter func(context.Context) (<-chan nix.Importable, <-chan error) + switch source.Importer { + case config.Packages: + exporter = storage.MakeSourceExporter[nix.Package](imp.options.Storage, source) + case config.Options: + exporter = storage.MakeSourceExporter[nix.Option](imp.options.Storage, source) + } + return pipe( ctx, imp.options.Logger, - storage.MakeSourceExporter(imp.options.Storage, source), + exporter, func(ctx context.Context, objects <-chan nix.Importable) <-chan error { return imp.options.WriteIndex.Import(ctx, objects) },