nixpkgs/pkgs/applications/networking/cluster/velero/default.nix

52 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "velero";
2021-04-15 11:19:42 +00:00
# When updating, change the commit underneath
2021-08-14 16:57:16 +00:00
version = "1.6.3";
2021-08-02 02:07:26 +00:00
commit = "8c9cdb9603446760452979dc77f93b17054ea1cc";
2021-04-15 11:19:42 +00:00
src = fetchFromGitHub {
rev = "v${version}";
owner = "vmware-tanzu";
repo = "velero";
2021-08-14 16:57:16 +00:00
sha256 = "sha256-oFDTjpcwlvSiAROG/EKYRCD+qKyZXu1gKotBcD0dfvk=";
};
buildFlagsArray = ''
-ldflags=
-s -w
-X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${version}
2021-04-15 11:19:42 +00:00
-X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA=${commit}
-X github.com/vmware-tanzu/velero/pkg/buildinfo.GitTreeState=clean
'';
2021-08-14 16:57:16 +00:00
vendorSha256 = "sha256-ypgrdv6nVW+AAwyVsiROXs6jGgDTodGrGqiT2s5elOU=";
2021-08-02 02:07:26 +00:00
excludedPackages = [ "issue-template-gen" "crd-gen" "release-tools" "velero-restic-restore-helper" ];
2021-08-02 02:07:26 +00:00
doCheck = false; # Tests expect a running cluster see https://github.com/vmware-tanzu/velero/tree/main/test/e2e
doInstallCheck = true;
installCheckPhase = ''
$out/bin/velero version --client-only | grep ${version} > /dev/null
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$out/bin/velero completion bash > velero.bash
$out/bin/velero completion zsh > velero.zsh
installShellCompletion velero.{bash,zsh}
'';
meta = with lib; {
description =
"A utility for managing disaster recovery, specifically for your Kubernetes cluster resources and persistent volumes";
homepage = "https://velero.io/";
changelog =
"https://github.com/vmware-tanzu/velero/releases/tag/v${version}";
license = licenses.asl20;
maintainers = [ maintainers.mbode maintainers.bryanasdev000 ];
};
}