2023-10-17 09:01:39 +00:00
|
|
|
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles }:
|
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";
|
2023-11-22 13:27:18 +00:00
|
|
|
version = "0.17.0";
|
2022-01-21 09:45:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "loft-sh";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-22 13:27:18 +00:00
|
|
|
hash = "sha256-xmSp3cNqNv48gBWpt0Pnvl3l5gIyV1oPNGrB58X+OVU=";
|
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" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
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
|
|
|
|
|
|
|
# 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) \
|
|
|
|
--zsh <($out/bin/vcluster completion zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Create fully functional virtual Kubernetes clusters";
|
|
|
|
downloadPage = "https://github.com/loft-sh/vcluster";
|
|
|
|
homepage = "https://www.vcluster.com/";
|
|
|
|
license = licenses.asl20;
|
2023-06-08 14:02:22 +00:00
|
|
|
maintainers = with maintainers; [ peterromfeldhk berryp qjoly ];
|
2022-01-21 09:45:34 +00:00
|
|
|
};
|
|
|
|
}
|