mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-11 23:44:13 +00:00
ccbc56db13
Release: https://github.com/loft-sh/vcluster/releases/tag/v0.18.1 Changelog: https://github.com/loft-sh/vcluster/compare/v0.17.0...v0.18.1 * Add version test * Add fish shell completion
56 lines
1.4 KiB
Nix
56 lines
1.4 KiB
Nix
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles, testers, vcluster }:
|
|
|
|
buildGoModule rec {
|
|
pname = "vcluster";
|
|
version = "0.18.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "loft-sh";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-TJjMB7x8MOlr3GexsnOZBFPJovVkf4ByRn1aGprvZFQ=";
|
|
};
|
|
|
|
vendorHash = null;
|
|
|
|
subPackages = [ "cmd/vclusterctl" ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s" "-w"
|
|
"-X main.version=${version}"
|
|
"-X main.goVersion=${lib.getVersion go}"
|
|
];
|
|
|
|
# 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) \
|
|
--zsh <($out/bin/vcluster completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = vcluster;
|
|
command = "vcluster --version";
|
|
};
|
|
|
|
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 qjoly ];
|
|
};
|
|
}
|