nixpkgs/pkgs/applications/networking/cluster/clusterctl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, clusterctl }:
2021-11-12 22:14:17 +00:00
buildGoModule rec {
pname = "clusterctl";
2024-04-17 00:30:30 +00:00
version = "1.7.0";
2021-11-12 22:14:17 +00:00
src = fetchFromGitHub {
owner = "kubernetes-sigs";
repo = "cluster-api";
rev = "v${version}";
2024-04-17 00:30:30 +00:00
hash = "sha256-pG0jr+LCKMwJGDndEZw6vho3zylsoGBVdXqruSS7SDQ=";
2021-11-12 22:14:17 +00:00
};
2024-04-17 00:30:30 +00:00
vendorHash = "sha256-ALRnccGjPGuAITtuz79Cao95NhvSczAzspSMXytlw+A=";
2021-11-12 22:14:17 +00:00
subPackages = [ "cmd/clusterctl" ];
nativeBuildInputs = [ installShellFiles ];
ldflags = let t = "sigs.k8s.io/cluster-api/version"; in [
"-X ${t}.gitMajor=${lib.versions.major version}"
"-X ${t}.gitMinor=${lib.versions.minor version}"
"-X ${t}.gitVersion=v${version}"
];
postInstall = ''
# errors attempting to write config to read-only $HOME
export HOME=$TMPDIR
2021-11-12 22:14:17 +00:00
installShellCompletion --cmd clusterctl \
--bash <($out/bin/clusterctl completion bash) \
--zsh <($out/bin/clusterctl completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = clusterctl;
command = "HOME=$TMPDIR clusterctl version";
version = "v${version}";
};
2021-11-12 22:14:17 +00:00
meta = with lib; {
changelog = "https://github.com/kubernetes-sigs/cluster-api/releases/tag/${src.rev}";
2021-11-12 22:14:17 +00:00
description = "Kubernetes cluster API tool";
mainProgram = "clusterctl";
2021-11-12 22:14:17 +00:00
homepage = "https://cluster-api.sigs.k8s.io/";
license = licenses.asl20;
2023-08-06 10:23:05 +00:00
maintainers = with maintainers; [ qjoly ];
2021-11-12 22:14:17 +00:00
};
}