all repos — searchix @ f896b6861faae07485b8f7bee2e9b607527882c1

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix: storage error

Alan Pearce
commit

f896b6861faae07485b8f7bee2e9b607527882c1

parent

ea0ba76e248bc1ec5f11c49dfdf6fed7de0f6c9f

1 file changed, 9 insertions(+), 1 deletion(-)

changed files
M internal/importer/importer.gointernal/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) },