bazel: move configuration file to a proper nix store entry

Easier to read and maintain

+10 -8
+10 -8
pkgs/development/tools/build-managers/bazel/default.nix
··· 21 , autoPatchelfHook 22 , file 23 , substituteAll 24 }: 25 26 let ··· 123 installPhase = '' 124 cp -Ra * $out/ 125 touch $out/WORKSPACE 126 ''; 127 }; 128 ··· 423 # override this path to a builtin one 424 substituteInPlace \ 425 src/main/cpp/option_processor.cc \ 426 - --replace BAZEL_SYSTEM_BAZELRC_PATH "\"$out/etc/bazelrc\"" 427 ''; 428 in lib.optionalString stdenv.hostPlatform.isDarwin darwinPatches 429 + genericPatches; ··· 476 mv ./bazel_src/output/bazel $out/bin/bazel-real 477 478 wrapProgram "$out/bin/bazel" --add-flags --server_javabase="${runJdk}" 479 - 480 - # generates the system bazelrc 481 - # warning: the name of the repository depends on the system, hence 482 - # the reference to .name 483 - mkdir $out/etc 484 - echo "build --override_repository=${remote_java_tools.name}=${remote_java_tools}" > $out/etc/bazelrc 485 - echo "build --distdir=${distDir}" >> $out/etc/bazelrc 486 487 # shell completion files 488 mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions
··· 21 , autoPatchelfHook 22 , file 23 , substituteAll 24 + , writeTextFile 25 }: 26 27 let ··· 124 installPhase = '' 125 cp -Ra * $out/ 126 touch $out/WORKSPACE 127 + ''; 128 + }; 129 + 130 + bazelRC = writeTextFile { 131 + name = "bazel-rc"; 132 + text = '' 133 + build --override_repository=${remote_java_tools.name}=${remote_java_tools} 134 + build --distdir=${distDir} 135 ''; 136 }; 137 ··· 432 # override this path to a builtin one 433 substituteInPlace \ 434 src/main/cpp/option_processor.cc \ 435 + --replace BAZEL_SYSTEM_BAZELRC_PATH "\"${bazelRC}\"" 436 ''; 437 in lib.optionalString stdenv.hostPlatform.isDarwin darwinPatches 438 + genericPatches; ··· 485 mv ./bazel_src/output/bazel $out/bin/bazel-real 486 487 wrapProgram "$out/bin/bazel" --add-flags --server_javabase="${runJdk}" 488 489 # shell completion files 490 mkdir -p $out/share/bash-completion/completions $out/share/zsh/site-functions