Skip to content

Commit

Permalink
Don't evaluate all attrs passed into mkSearchData (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Oct 26, 2024
1 parent 6ee67ef commit cf1d132
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions nix/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
{
Expand Down

0 comments on commit cf1d132

Please sign in to comment.