nixpkgs/pkgs/by-name/vc/vcluster/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
1.6 KiB
Nix
Raw Normal View History

2024-07-22 13:15:30 +00:00
{
buildGoModule,
fetchFromGitHub,
go,
installShellFiles,
lib,
nix-update-script,
testers,
vcluster,
}:
2022-01-21 09:45:34 +00:00
buildGoModule rec {
2022-01-21 09:45:34 +00:00
pname = "vcluster";
version = "0.19.7";
2022-01-21 09:45:34 +00:00
src = fetchFromGitHub {
owner = "loft-sh";
repo = "vcluster";
2022-01-21 09:45:34 +00:00
rev = "v${version}";
hash = "sha256-sO/kpbzoAy4ohmLZ3Q7+HzoC0NoK2y0qkJ6Ib8TlEns=";
2022-01-21 09:45:34 +00:00
};
2023-06-23 15:01:59 +00:00
vendorHash = null;
2022-01-21 09:45:34 +00:00
subPackages = [ "cmd/vclusterctl" ];
2023-10-17 09:01:39 +00:00
ldflags = [
2024-07-22 13:15:30 +00:00
"-s"
"-w"
2023-10-17 09:01:39 +00:00
"-X main.version=${version}"
"-X main.goVersion=${lib.getVersion go}"
];
2022-01-21 09:45:34 +00:00
nativeBuildInputs = [ installShellFiles ];
2022-01-21 09:45:34 +00:00
# Test is disabled because e2e tests expect k8s.
doCheck = false;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -Dm755 "$GOPATH/bin/vclusterctl" -T $out/bin/vcluster
runHook postInstall
'';
postInstall = ''
installShellCompletion --cmd vcluster \
--bash <($out/bin/vcluster completion bash) \
--fish <($out/bin/vcluster completion fish) \
2022-01-21 09:45:34 +00:00
--zsh <($out/bin/vcluster completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = vcluster;
command = "vcluster --version";
};
2024-07-22 13:06:28 +00:00
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/loft-sh/vcluster/releases/tag/v${version}";
2022-01-21 09:45:34 +00:00
description = "Create fully functional virtual Kubernetes clusters";
downloadPage = "https://github.com/loft-sh/vcluster";
homepage = "https://www.vcluster.com/";
license = lib.licenses.asl20;
mainProgram = "vcluster";
2024-07-22 13:15:30 +00:00
maintainers = with lib.maintainers; [
berryp
peterromfeldhk
qjoly
superherointj
];
2022-01-21 09:45:34 +00:00
};
}