all repos — searchix @ a90419aa46ec42588f65e6327559ce479f9c5b67

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

feat(config): use enums' string representations to print defaults

Alan Pearce
commit

a90419aa46ec42588f65e6327559ce479f9c5b67

parent

be3bab7fc4f8c3efc87cf7cfcc83d63177fdd7b9

3 files changed, 16 insertions(+), 8 deletions(-)

jump to
M defaults.tomldefaults.toml
@@ -54,8 +54,8 @@ [Importer.Sources.darwin]
Name = 'Darwin' Key = 'darwin' Enable = false -Fetcher = 1 -Importer = 2 +Fetcher = 'channel' +Importer = 'options' Channel = 'darwin' URL = 'https://github.com/LnL7/nix-darwin/archive/master.tar.gz' Attribute = 'options'
@@ -74,8 +74,8 @@ [Importer.Sources.home-manager]
Name = 'Home Manager' Key = 'home-manager' Enable = false -Fetcher = 1 -Importer = 2 +Fetcher = 'channel' +Importer = 'options' Channel = 'home-manager' URL = 'https://github.com/nix-community/home-manager/archive/master.tar.gz' Attribute = 'docs.json'
@@ -94,8 +94,8 @@ [Importer.Sources.nixos]
Name = 'NixOS' Key = 'nixos' Enable = true -Fetcher = 1 -Importer = 2 +Fetcher = 'channel' +Importer = 'options' Channel = 'nixpkgs' URL = 'https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz' Attribute = 'options'
@@ -114,8 +114,8 @@ [Importer.Sources.nixpkgs]
Name = 'Nix Packages' Key = 'nixpkgs' Enable = true -Fetcher = 2 -Importer = 1 +Fetcher = 'channel-nixpkgs' +Importer = 'packages' Channel = 'nixos-unstable' URL = '' Attribute = ''
M internal/config/fetcher.gointernal/config/fetcher.go
@@ -47,3 +47,7 @@ *f, err = ParseFetcher(string(text))
return err } + +func (f *Fetcher) MarshalText() ([]byte, error) { + return []byte(f.String()), nil +}
M internal/config/importer-type.gointernal/config/importer-type.go
@@ -42,3 +42,7 @@ *i, err = ParseImporterType(string(text))
return err } + +func (i *ImporterType) MarshalText() ([]byte, error) { + return []byte(i.String()), nil +}