Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
63 lines
1.6 KiB
Nix
63 lines
1.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
testers,
|
|
clusterctl,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "clusterctl";
|
|
version = "1.11.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kubernetes-sigs";
|
|
repo = "cluster-api";
|
|
rev = "v${version}";
|
|
hash = "sha256-2l9Mk9CWmmzTflyC+ZWr2A7NyT78rf0bXQETvCYlLuM=";
|
|
};
|
|
|
|
vendorHash = "sha256-hnyw2n82nFBN+6Km9usIKSMSTxucdY497J957mP2eEo=";
|
|
|
|
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 = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
# errors attempting to write config to read-only $HOME
|
|
export HOME=$TMPDIR
|
|
|
|
installShellCompletion --cmd clusterctl \
|
|
--bash <($out/bin/clusterctl completion bash) \
|
|
--fish <($out/bin/clusterctl completion fish) \
|
|
--zsh <($out/bin/clusterctl completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = clusterctl;
|
|
command = "HOME=$TMPDIR clusterctl version";
|
|
version = "v${version}";
|
|
};
|
|
|
|
meta = {
|
|
changelog = "https://github.com/kubernetes-sigs/cluster-api/releases/tag/${src.rev}";
|
|
description = "Kubernetes cluster API tool";
|
|
mainProgram = "clusterctl";
|
|
homepage = "https://cluster-api.sigs.k8s.io/";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ qjoly ];
|
|
};
|
|
}
|