about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go6
-rw-r--r--internal/config/repository.go6
2 files changed, 8 insertions, 4 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index a0a05eb..0b3b9ba 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -94,7 +94,7 @@ func mustLocalTime(in string) (time LocalTime) {
 }
 
 var nixpkgs = Repository{
-	Type:  "github",
+	Type:  GitHub,
 	Owner: "NixOS",
 	Repo:  "nixpkgs",
 }
@@ -146,7 +146,7 @@ var defaultConfig = Config{
 				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 @@ var defaultConfig = Config{
 				FetchTimeout:  Duration{5 * time.Minute},
 				ImportTimeout: Duration{15 * time.Minute},
 				Repo: Repository{
-					Type:  "github",
+					Type:  GitHub,
 					Owner: "nix-community",
 					Repo:  "home-manager",
 				},
diff --git a/internal/config/repository.go b/internal/config/repository.go
index 44d8251..a074cbc 100644
--- a/internal/config/repository.go
+++ b/internal/config/repository.go
@@ -13,7 +13,7 @@ const (
 )
 
 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 @@ func (f *RepoType) UnmarshalText(text []byte) error {
 
 	return err
 }
+
+func (f *RepoType) MarshalText() ([]byte, error) {
+	return []byte(f.String()), nil
+}