| { hscloud, pkgs, ... }: |
| |
| # This supports building laserproxy in nix, which is used for deploying it to customs. |
| # This is mildly hacky and should be reworked to function for any hscloud bazel target |
| # in a more generic fashion. |
| # |
| # To build: |
| # ~/hscloud $ nix-build -A hswaw.laserproxy |
| |
| pkgs.buildBazelPackage rec { |
| name = "laserproxy"; |
| src = hscloud.root; |
| bazelTarget = "//hswaw/laserproxy"; |
| nativeBuildInputs = with pkgs; [ |
| git python3 postgresql go |
| ]; |
| patches = [ |
| ./nix-disable-uwsgi.patch |
| ./nix-use-system-go.patch |
| ./nix-disable-workspace-status.patch |
| ]; |
| |
| removeRulesCC = false; |
| fetchConfigured = true; |
| fetchAttrs = { |
| inherit patches; |
| # Nicked from nixpkgs usages of buildBazelPackage. |
| preInstall = '' |
| rm -rf $bazelOut/external/{go_sdk,\@go_sdk.marker} |
| sed -e '/^FILE:@go_sdk.*/d' -i $bazelOut/external/\@*.marker |
| |
| chmod -R 755 $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker} |
| rm -rf $bazelOut/external/{bazel_gazelle_go_repository_cache,@\bazel_gazelle_go_repository_cache.marker} |
| |
| rm -rf $bazelOut/external/{bazel_gazelle_go_repository_tools,\@bazel_gazelle_go_repository_tools.marker} |
| sed -e '/^FILE:@bazel_gazelle_go_repository_tools.*/d' -i $bazelOut/external/\@*.marker |
| ''; |
| sha256 = "0d0vlls1i0nmlqiszfhwb0cn1kwll3ffxd3sn30pk7drhfrbvqhf"; |
| }; |
| buildAttrs = { |
| inherit patches; |
| installPhase = '' |
| install -Dm755 bazel-bin/hswaw/laserproxy/*/laserproxy $out/bin/laserproxy |
| ''; |
| }; |
| } |