about summary refs log tree commit diff stats
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-23 13:22:50 +0200
committerAlan Pearce2024-05-23 13:22:50 +0200
commit052fce5bf2b1995fe45b88626e5342e61933d7cd (patch)
treee3c9b49250acee26c6aee1d43501c1cdddb83fc6 /internal/config/config.go
parent0dbfe37fbddb95c184d845c79bbe014597d55fe8 (diff)
downloadsearchix-052fce5bf2b1995fe45b88626e5342e61933d7cd.tar.lz
searchix-052fce5bf2b1995fe45b88626e5342e61933d7cd.tar.zst
searchix-052fce5bf2b1995fe45b88626e5342e61933d7cd.zip
refactor: use a single value for per-source import timeouts
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go90
1 files changed, 43 insertions, 47 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 0b3b9ba..c2e026c 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -118,33 +118,31 @@ var defaultConfig = Config{
 		UpdateAt: mustLocalTime("04:00:00"),
 		Sources: map[string]*Source{
 			"nixos": {
-				Name:          "NixOS",
-				Key:           "nixos",
-				Enable:        true,
-				Importer:      Options,
-				Fetcher:       Channel,
-				Channel:       "nixpkgs",
-				URL:           "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz",
-				ImportPath:    "nixos/release.nix",
-				Attribute:     "options",
-				OutputPath:    "share/doc/nixos",
-				FetchTimeout:  Duration{5 * time.Minute},
-				ImportTimeout: Duration{15 * time.Minute},
-				Repo:          nixpkgs,
+				Name:       "NixOS",
+				Key:        "nixos",
+				Enable:     true,
+				Importer:   Options,
+				Fetcher:    Channel,
+				Channel:    "nixpkgs",
+				URL:        "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz",
+				ImportPath: "nixos/release.nix",
+				Attribute:  "options",
+				OutputPath: "share/doc/nixos",
+				Timeout:    Duration{5 * time.Minute},
+				Repo:       nixpkgs,
 			},
 			"darwin": {
-				Name:          "Darwin",
-				Key:           "darwin",
-				Enable:        false,
-				Importer:      Options,
-				Fetcher:       Channel,
-				Channel:       "darwin",
-				URL:           "https://github.com/LnL7/nix-darwin/archive/master.tar.gz",
-				ImportPath:    "release.nix",
-				Attribute:     "options",
-				OutputPath:    "share/doc/darwin",
-				FetchTimeout:  Duration{5 * time.Minute},
-				ImportTimeout: Duration{15 * time.Minute},
+				Name:       "Darwin",
+				Key:        "darwin",
+				Enable:     false,
+				Importer:   Options,
+				Fetcher:    Channel,
+				Channel:    "darwin",
+				URL:        "https://github.com/LnL7/nix-darwin/archive/master.tar.gz",
+				ImportPath: "release.nix",
+				Attribute:  "options",
+				OutputPath: "share/doc/darwin",
+				Timeout:    Duration{5 * time.Minute},
 				Repo: Repository{
 					Type:  GitHub,
 					Owner: "LnL7",
@@ -152,18 +150,17 @@ var defaultConfig = Config{
 				},
 			},
 			"home-manager": {
-				Name:          "Home Manager",
-				Key:           "home-manager",
-				Enable:        false,
-				Importer:      Options,
-				Channel:       "home-manager",
-				URL:           "https://github.com/nix-community/home-manager/archive/master.tar.gz",
-				Fetcher:       Channel,
-				ImportPath:    "default.nix",
-				Attribute:     "docs.json",
-				OutputPath:    "share/doc/home-manager",
-				FetchTimeout:  Duration{5 * time.Minute},
-				ImportTimeout: Duration{15 * time.Minute},
+				Name:       "Home Manager",
+				Key:        "home-manager",
+				Enable:     false,
+				Importer:   Options,
+				Channel:    "home-manager",
+				URL:        "https://github.com/nix-community/home-manager/archive/master.tar.gz",
+				Fetcher:    Channel,
+				ImportPath: "default.nix",
+				Attribute:  "docs.json",
+				OutputPath: "share/doc/home-manager",
+				Timeout:    Duration{5 * time.Minute},
 				Repo: Repository{
 					Type:  GitHub,
 					Owner: "nix-community",
@@ -171,16 +168,15 @@ var defaultConfig = Config{
 				},
 			},
 			"nixpkgs": {
-				Name:          "Nix Packages",
-				Key:           "nixpkgs",
-				Enable:        true,
-				Importer:      Packages,
-				Fetcher:       ChannelNixpkgs,
-				Channel:       "nixos-unstable",
-				OutputPath:    "packages.json.br",
-				FetchTimeout:  Duration{5 * time.Minute},
-				ImportTimeout: Duration{15 * time.Minute},
-				Repo:          nixpkgs,
+				Name:       "Nix Packages",
+				Key:        "nixpkgs",
+				Enable:     true,
+				Importer:   Packages,
+				Fetcher:    ChannelNixpkgs,
+				Channel:    "nixos-unstable",
+				OutputPath: "packages.json.br",
+				Timeout:    Duration{5 * time.Minute},
+				Repo:       nixpkgs,
 			},
 		},
 	},