all repos — searchix @ 9b24b805b45c71bb54dacc1112380357050f48af

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

fix: panic on importing darwin options
Alan Pearce alan@alanpearce.eu
Tue, 07 May 2024 11:24:14 +0200
commit

9b24b805b45c71bb54dacc1112380357050f48af

parent

8c1332020d25f74baa463bb1cec0e6783f565034

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M internal/options/process.gointernal/options/process.go
@@ -156,7 +156,12 @@ ) 				}
 				decls = append(decls, link)
 			case reflect.Map:
-				decls = append(decls, decl.Convert(reflect.TypeFor[Link]()).Interface().(*Link))
+				v := decl.Interface().(map[string]interface{})
+				link := Link{
+					Name: v["name"].(string),
+					URL:  v["url"].(string),
+				}
+				decls = append(decls, &link)
 			default:
 				println("kind", decl.Kind().String())
 				panic("unexpected object type")