diff options
author | Alan Pearce | 2024-05-09 18:18:59 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:27:57 +0200 |
commit | fbc4c583a4e2759d6b8cdbb98de2c769918ddac8 (patch) | |
tree | 2b5bd7317e426746781071f771f5ad7979988503 /internal/config | |
parent | 8d5dfd90332facb2613b927cf32472915f87359d (diff) | |
download | searchix-fbc4c583a4e2759d6b8cdbb98de2c769918ddac8.tar.lz searchix-fbc4c583a4e2759d6b8cdbb98de2c769918ddac8.tar.zst searchix-fbc4c583a4e2759d6b8cdbb98de2c769918ddac8.zip |
docs: embed defaults in app
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 50 |
1 files changed, 42 insertions, 8 deletions
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", + }, + }, }, } |