2023-12-16 11:28:17 +00:00
|
|
|
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles, 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-03-25 12:16:14 +00:00
|
|
|
version = "0.19.5";
|
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-03-25 12:16:14 +00:00
|
|
|
hash = "sha256-V+Y2LekBYlKZU53BsYCW6ADSMJOxkwSK9hbFGXBaa9o=";
|
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 = [
|
|
|
|
"-s" "-w"
|
|
|
|
"-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-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-03-05 20:13:12 +00:00
|
|
|
maintainers = with lib.maintainers; [ berryp peterromfeldhk qjoly superherointj ];
|
2022-01-21 09:45:34 +00:00
|
|
|
};
|
|
|
|
}
|