nix/pkgs/copybara: create

This commit is contained in:
Luke Granger-Brown 2020-05-16 16:37:45 +01:00
parent 921e7aee81
commit 9b64e2c361
2 changed files with 35 additions and 0 deletions

34
nix/pkgs/copybara.nix Normal file
View file

@ -0,0 +1,34 @@
{ pkgs, ... }:
pkgs.buildBazelPackage rec {
name = "copybara";
version = "master";
src = ../../third_party/copybara;
nativeBuildInputs = with pkgs; [ git mercurial jdk makeWrapper ];
bazelTarget = "//java/com/google/copybara:copybara_deploy.jar";
removeRulesCC = false;
bazelFlags = [
"--javabase=@local_jdk//:jdk"
"--host_javabase=@local_jdk//:jdk"
"--java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8"
"--host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8"
];
fetchAttrs = {
sha256 = "0l76jrr8w5x28464cbz7vbv1lim6zjdd4z6xclb5lghw507nlk70";
preHook = ''
export COURSIER_CACHE="$(echo ''${NIX_BUILD_TOP}/tmp/coursier | sed -e 's,//,/,g')"
'';
};
buildAttrs = {
installPhase = ''
mkdir -p $out/bin $out/share/java
install -Dm755 bazel-bin/java/com/google/copybara/copybara_deploy.jar $out/share/java/copybara.jar
makeWrapper ${pkgs.jre}/bin/java $out/bin/copybara \
--add-flags "-cp $out/share/java/copybara.jar com.google.copybara.Main"
'';
};
}

View file

@ -2,4 +2,5 @@ args: {
javaws-env = import ./javaws-env.nix args; javaws-env = import ./javaws-env.nix args;
plex-pass = import ./plex-pass.nix args; plex-pass = import ./plex-pass.nix args;
secretsync = import ./secretsync args; secretsync = import ./secretsync args;
copybara = import ./copybara.nix args;
} // (import ./heptapod-runner.nix args) } // (import ./heptapod-runner.nix args)