about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
authorAlan Pearce2024-05-10 12:56:26 +0200
committerAlan Pearce2024-05-11 15:19:52 +0200
commit0eccb18ab0a7241c1f6f5fee99a3961101e35392 (patch)
tree40ea364b099ef4c49c04fa03bc5273167afd5d11 /internal
parent6789940f52e852426f224bcdbc9e6f6a8cb7be41 (diff)
downloadsearchix-0eccb18ab0a7241c1f6f5fee99a3961101e35392.tar.lz
searchix-0eccb18ab0a7241c1f6f5fee99a3961101e35392.tar.zst
searchix-0eccb18ab0a7241c1f6f5fee99a3961101e35392.zip
fix: no results for home-manager search
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go3
-rw-r--r--internal/importer/importer.go1
-rw-r--r--internal/importer/ingest.go3
3 files changed, 5 insertions, 2 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index adb8d7b..ff21a54 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -44,6 +44,7 @@ var defaultConfig = Config{
 	Sources: map[string]*importer.Source{
 		"nixos": {
 			Name:          "NixOS",
+			Key:           "nixos",
 			Enable:        true,
 			Type:          importer.Channel,
 			Channel:       "nixpkgs",
@@ -60,6 +61,7 @@ var defaultConfig = Config{
 		},
 		"darwin": {
 			Name:          "Darwin",
+			Key:           "darwin",
 			Enable:        false,
 			Type:          importer.Channel,
 			Channel:       "nix-darwin",
@@ -76,6 +78,7 @@ var defaultConfig = Config{
 		},
 		"home-manager": {
 			Name:          "Home Manager",
+			Key:           "home-manager",
 			Enable:        false,
 			Channel:       "home-manager",
 			Type:          importer.Channel,
diff --git a/internal/importer/importer.go b/internal/importer/importer.go
index 8a18c60..30ab2f6 100644
--- a/internal/importer/importer.go
+++ b/internal/importer/importer.go
@@ -11,6 +11,7 @@ import (
 
 type Source struct {
 	Name          string
+	Key           string
 	Enable        bool
 	Type          Type
 	Channel       string
diff --git a/internal/importer/ingest.go b/internal/importer/ingest.go
index 0044d67..08d0366 100644
--- a/internal/importer/ingest.go
+++ b/internal/importer/ingest.go
@@ -8,7 +8,6 @@ import (
 	"os"
 	"reflect"
 	"searchix/internal/options"
-	"strings"
 
 	"github.com/bcicen/jstream"
 	"github.com/mitchellh/mapstructure"
@@ -221,7 +220,7 @@ func (i *OptionIngester) Process(ctx context.Context) (<-chan *options.NixOption
 			// slog.Debug("sending option", "name", kv.Key)
 			results <- &options.NixOption{
 				Name:            kv.Key,
-				Source:          strings.ToLower(i.source.Name),
+				Source:          i.source.Key,
 				Declarations:    decs,
 				Default:         convertNixValue(i.optJSON.Default),
 				Description:     options.Markdown(i.optJSON.Description),