about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
authorAlan Pearce2024-05-16 20:31:28 +0200
committerAlan Pearce2024-05-16 20:31:28 +0200
commit8b78a98af573a77a6d6aa6a0b231d4b657e35726 (patch)
tree1a29aaed4f4c7820fc3bdba68e0e09ae77ad6993 /internal
parentc51ca7c62e08f43ef9974af35886d30ce54a1f22 (diff)
downloadsearchix-8b78a98af573a77a6d6aa6a0b231d4b657e35726.tar.lz
searchix-8b78a98af573a77a6d6aa6a0b231d4b657e35726.tar.zst
searchix-8b78a98af573a77a6d6aa6a0b231d4b657e35726.zip
feat: extract and store package set (e.g. nodePackages)
Diffstat (limited to 'internal')
-rw-r--r--internal/importer/package.go8
-rw-r--r--internal/nix/package.go1
2 files changed, 8 insertions, 1 deletions
diff --git a/internal/importer/package.go b/internal/importer/package.go
index a1bc9fb..49e313d 100644
--- a/internal/importer/package.go
+++ b/internal/importer/package.go
@@ -226,9 +226,15 @@ func (i *PackageIngester) Process(
 
 			subpath, line, _ := strings.Cut(i.pkg.Meta.Position, ":")
 
-			results <- nix.Package{
+			pkgSet, _, found := strings.Cut(kv.Key, ".")
+			if !found {
+				pkgSet = ""
+			}
+
+			results <- &nix.Package{
 				Name:            i.pkg.Name,
 				Source:          i.source.Key,
+				PackageSet:      pkgSet,
 				Version:         i.pkg.Version,
 				Broken:          i.pkg.Meta.Broken,
 				Description:     i.pkg.Meta.Description,
diff --git a/internal/nix/package.go b/internal/nix/package.go
index 4158d1f..ddfee09 100644
--- a/internal/nix/package.go
+++ b/internal/nix/package.go
@@ -11,6 +11,7 @@ type Package struct {
 	LongDescription string
 	MainProgram     string
 	Maintainers     []Maintainer
+	PackageSet      string
 	Platforms       []string
 	Version         string
 }