···310310 bazelTest = { name, bazelScript, workspaceDir, bazelPkg, buildInputs ? [] }:
311311 let
312312 be = extracted bazelPkg;
313313- in runLocal name { inherit buildInputs; } (
313313+ in runLocal name {
314314+ inherit buildInputs;
315315+ # Necessary for the tests to pass on Darwin with sandbox enabled.
316316+ __darwinAllowLocalNetworking = true;
317317+ } (
314318 # skip extraction caching on Darwin, because nobody knows how Darwin works
315319 (lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
316320 # set up home with pre-unpacked bazel