about summary refs log tree commit diff stats
path: root/internal/nix
diff options
context:
space:
mode:
authorAlan Pearce2024-06-08 20:31:47 +0200
committerAlan Pearce2024-06-08 20:42:48 +0200
commitd40c0e188a7fe1b36887f59c4a9958faa81b3d44 (patch)
treeb6c168adcc3336dd0f6de4b1cbb7bf671f212f53 /internal/nix
parentef6c98da84c2327e0a0003fb3b1b64a5d1e2d550 (diff)
downloadsearchix-d40c0e188a7fe1b36887f59c4a9958faa81b3d44.tar.lz
searchix-d40c0e188a7fe1b36887f59c4a9958faa81b3d44.tar.zst
searchix-d40c0e188a7fe1b36887f59c4a9958faa81b3d44.zip
feat: add detail pages for packages/options
Diffstat (limited to 'internal/nix')
-rw-r--r--internal/nix/importable.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/nix/importable.go b/internal/nix/importable.go
index 37532cd..67ba96d 100644
--- a/internal/nix/importable.go
+++ b/internal/nix/importable.go
@@ -1,6 +1,9 @@
 package nix
 
-import "encoding/gob"
+import (
+	"encoding/gob"
+	"searchix/internal/config"
+)
 
 type Importable interface {
 	BleveType() string
@@ -12,6 +15,10 @@ func GetKey(i Importable) string {
 	return i.BleveType() + "/" + i.GetSource() + "/" + i.GetName()
 }
 
+func MakeKey(source *config.Source, id string) string {
+	return source.Importer.Singular() + "/" + source.Key + "/" + id
+}
+
 func init() {
 	gob.Register(Option{})
 	gob.Register(Package{})