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
|
|
|
|
2022-02-04 12:16:47 +00:00
|
|
|
buildGoModule rec {
|
2022-01-21 09:45:34 +00:00
|
|
|
pname = "vcluster";
|
2024-07-22 13:08:38 +00:00
|
|
|
version = "0.19.7";
|
2022-01-21 09:45:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "loft-sh";
|
2024-03-05 20:13:12 +00:00
|
|
|
repo = "vcluster";
|
2022-01-21 09:45:34 +00:00
|
|
|
rev = "v${version}";
|
2024-07-22 13:08:38 +00:00
|
|
|
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
|
|
|
|
2024-03-25 12:16:14 +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) \
|
2023-12-16 11:28:17 +00:00
|
|
|
--fish <($out/bin/vcluster completion fish) \
|
2022-01-21 09:45:34 +00:00
|
|
|
--zsh <($out/bin/vcluster completion zsh)
|
|
|
|
'';
|
|
|
|
|
2023-12-16 11:28:17 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = vcluster;
|
|
|
|
command = "vcluster --version";
|
|
|
|
};
|
|
|
|
|
2024-07-22 13:06:28 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2024-03-05 20:13:12 +00:00
|
|
|
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/";
|
2024-03-05 20:13:12 +00:00
|
|
|
license = lib.licenses.asl20;
|
2024-03-25 12:16:14 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|