all repos — searchix @ 4ac6e917aafa02825bef4f213b2c41fd902a4baf

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor: use enum for Repository.Type

Alan Pearce
commit

4ac6e917aafa02825bef4f213b2c41fd902a4baf

parent

e70431d68dced8754e94228753359b2130fd075a

2 files changed, 8 insertions(+), 4 deletions(-)

jump to
M internal/config/config.gointernal/config/config.go
@@ -94,7 +94,7 @@ return
} var nixpkgs = Repository{ - Type: "github", + Type: GitHub, Owner: "NixOS", Repo: "nixpkgs", }
@@ -146,7 +146,7 @@ OutputPath: "share/doc/darwin",
FetchTimeout: Duration{5 * time.Minute}, ImportTimeout: Duration{15 * time.Minute}, Repo: Repository{ - Type: "github", + Type: GitHub, Owner: "LnL7", Repo: "nix-darwin", },
@@ -165,7 +165,7 @@ OutputPath: "share/doc/home-manager",
FetchTimeout: Duration{5 * time.Minute}, ImportTimeout: Duration{15 * time.Minute}, Repo: Repository{ - Type: "github", + Type: GitHub, Owner: "nix-community", Repo: "home-manager", },
M internal/config/repository.gointernal/config/repository.go
@@ -13,7 +13,7 @@ GitHub
) type Repository struct { - Type string `toml:"" default:"github" comment:"Currently only 'github' is supported."` + Type RepoType `toml:"" default:"github" comment:"Currently only 'github' is supported."` Owner string Repo string Revision string `toml:"-"`
@@ -43,3 +43,7 @@ *f, err = parseRepoType(string(text))
return err } + +func (f *RepoType) MarshalText() ([]byte, error) { + return []byte(f.String()), nil +}