From fbc4c583a4e2759d6b8cdbb98de2c769918ddac8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 18:18:59 +0200 Subject: docs: embed defaults in app --- internal/config/config.go | 50 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 8 deletions(-) (limited to 'internal') diff --git a/internal/config/config.go b/internal/config/config.go index 94bf60e..2cf5def 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -7,6 +7,7 @@ import ( "os" "searchix/internal/file" "searchix/internal/importer" + "time" "github.com/pelletier/go-toml/v2" "github.com/pkg/errors" @@ -42,20 +43,53 @@ var defaultConfig = Config{ "x-content-type-options": "nosniff", }, Sources: map[string]importer.Source{ - "nixos": importer.Source{ - Name: "NixOS", - Enable: true, - Type: importer.Channel, - Channel: "nixos-unstable", - ImportPath: "nixos/release.nix", - Attribute: "options", - OutputPath: "share/doc/nixos/options.json", + "nixos": { + Name: "NixOS", + Enable: true, + Type: importer.Channel, + Channel: "nixpkgs", + ImportPath: "nixos/release.nix", + Attribute: "options", + OutputPath: "share/doc/nixos/options.json", + FetchTimeout: 5 * time.Minute, + ImportTimeout: 15 * time.Minute, Repo: importer.Repository{ Type: "github", Owner: "NixOS", Repo: "nixpkgs", }, }, + "darwin": { + Name: "darwin", + Enable: false, + Type: importer.Channel, + Channel: "nix-darwin", + ImportPath: "release.nix", + Attribute: "options", + OutputPath: "share/doc/darwin/options.json", + FetchTimeout: 5 * time.Minute, + ImportTimeout: 15 * time.Minute, + Repo: importer.Repository{ + Type: "github", + Owner: "LnL7", + Repo: "nix-darwin", + }, + }, + "home-manager": { + Name: "home-manager", + Enable: false, + Type: importer.Channel, + ImportPath: "default.nix", + Attribute: "docs.json", + OutputPath: "share/doc/home-manager/options.json", + FetchTimeout: 5 * time.Minute, + ImportTimeout: 15 * time.Minute, + Repo: importer.Repository{ + Type: "github", + Owner: "nix-community", + Repo: "home-manager", + }, + }, }, } -- cgit 1.4.1