My NixOS configurations + dotfiles

openclaw: hard-rewrite Brave web search endpoint to local shim

kris.darkworld.download a292a97d c95c70f9

verified
+5 -1
+5 -1
hosts/server/slop/openclaw.nix
··· 9 9 postInstall = (old.postInstall or "") + '' 10 10 # Point Brave web-search endpoint to local shim 11 11 if [ -d "$out/lib/openclaw/dist" ]; then 12 + # Web-search tool hardcodes Brave endpoint in bundled JS. 13 + # No runtime config option exists for Brave base URL in this OpenClaw version, 14 + # so rewrite it at build-time to local brave-shim. 12 15 grep -RIl "https://api.search.brave.com" "$out/lib/openclaw/dist" | while read -r f; do 13 16 substituteInPlace "$f" \ 17 + --replace "https://api.search.brave.com/res/v1/web/search" "http://127.0.0.1:8000/res/v1/web/search" \ 14 18 --replace "https://api.search.brave.com/res/v1/" "http://127.0.0.1:8000/res/v1/" \ 15 19 --replace "https://api.search.brave.com/" "http://127.0.0.1:8000/" \ 16 - --replace-fail "https://api.search.brave.com" "http://127.0.0.1:8000" 20 + --replace "https://api.search.brave.com" "http://127.0.0.1:8000" 17 21 done 18 22 fi 19 23 '';