mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "vcluster";
|
|
version = "0.12.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "loft-sh";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-PkayQ1sLjnA+1Xatgs0EvZTCTfWV5uoYYtnKX8OAwYQ=";
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
subPackages = [ "cmd/vclusterctl" ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
# 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;
|
|
maintainers = with maintainers; [ peterromfeldhk berryp ];
|
|
};
|
|
}
|