about summary refs log tree commit diff stats
path: root/internal/config
diff options
context:
space:
mode:
authorAlan Pearce2024-05-16 17:09:10 +0200
committerAlan Pearce2024-05-16 20:30:16 +0200
commit51f774aaced998ad3c7c31e370aea22cc2fdbbc5 (patch)
tree3e61aa5ce2de887d23ea0e8236fadf9c5f4ce2be /internal/config
parent9a2885694e2f8153151cc92772d2bea85672939a (diff)
downloadsearchix-51f774aaced998ad3c7c31e370aea22cc2fdbbc5.tar.lz
searchix-51f774aaced998ad3c7c31e370aea22cc2fdbbc5.tar.zst
searchix-51f774aaced998ad3c7c31e370aea22cc2fdbbc5.zip
feat(importer): process packages from nixpkgs package.json
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go22
1 files changed, 17 insertions, 5 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 490d1d5..eb46270 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -87,6 +87,12 @@ type Config struct {
 	Importer *Importer
 }
 
+var nixpkgs = Repository{
+	Type:  "github",
+	Owner: "NixOS",
+	Repo:  "nixpkgs",
+}
+
 var defaultConfig = Config{
 	DataPath: "./data",
 	Web: &Web{
@@ -117,11 +123,7 @@ var defaultConfig = Config{
 				OutputPath:    "share/doc/nixos/options.json",
 				FetchTimeout:  5 * time.Minute,
 				ImportTimeout: 15 * time.Minute,
-				Repo: Repository{
-					Type:  "github",
-					Owner: "NixOS",
-					Repo:  "nixpkgs",
-				},
+				Repo:          nixpkgs,
 			},
 			"darwin": {
 				Name:          "Darwin",
@@ -159,6 +161,16 @@ var defaultConfig = Config{
 					Repo:  "home-manager",
 				},
 			},
+			"nixpkgs": {
+				Name:          "Nix Packages",
+				Key:           "nixpkgs",
+				Enable:        true,
+				Type:          ChannelNixpkgs,
+				OutputPath:    "packages.json.br",
+				FetchTimeout:  5 * time.Minute,
+				ImportTimeout: 15 * time.Minute,
+				Repo:          nixpkgs,
+			},
 		},
 	},
 }