From cf1d13278345ec4fd6a52c124fff37faa7546ca7 Mon Sep 17 00:00:00 2001 From: Sandro Date: Sun, 27 Oct 2024 00:43:25 +0200 Subject: [PATCH] Don't evaluate all attrs passed into mkSearchData (#150) --- nix/wrapper.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/nix/wrapper.nix b/nix/wrapper.nix index accb7ed..e02bc64 100644 --- a/nix/wrapper.nix +++ b/nix/wrapper.nix @@ -18,15 +18,14 @@ rec { mkSearchData = scopes: let - optionsJSON = opt: opt.optionsJSON or (mkOptionsJSON { - inherit (opt) modules; - specialArgs = opt.specialArgs or { }; - }); - config = { - scopes = map - (scope: (lib.filterAttrs (name: _value: name != "modules") scope) // { optionsJson = optionsJSON scope; }) - scopes; - }; + config.scopes = map (scope: { + inherit (scope) urlPrefix; + } // lib.optionalAttrs (scope?name) { inherit (scope) name; } // { + optionsJson = scope.optionsJSON or (mkOptionsJSON { + modules = scope.modules or (throw "A scope requires either optionsJSON or module!"); + specialArgs = scope.specialArgs or { }; + }); + }) scopes; in runCommand "search-meta" {