summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/clusterctl
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2021-11-13 08:14:17 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2021-11-16 15:41:59 +1000
commitcd8f237c0c4eff99b30248ab647a78347ea3f7de (patch)
tree3ee6fe3ce88bb809d395bb59eb5a7d554c22d78a /pkgs/applications/networking/cluster/clusterctl
parent3db690fe70be6f8327ba390c49b70670679afbd8 (diff)
downloadnixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.tar
nixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.tar.gz
nixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.tar.bz2
nixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.tar.lz
nixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.tar.xz
nixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.tar.zst
nixpkgs-cd8f237c0c4eff99b30248ab647a78347ea3f7de.zip
clusterctl: init at 1.0.1
Diffstat (limited to 'pkgs/applications/networking/cluster/clusterctl')
-rw-r--r--pkgs/applications/networking/cluster/clusterctl/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/applications/networking/cluster/clusterctl/default.nix b/pkgs/applications/networking/cluster/clusterctl/default.nix
new file mode 100644
index 00000000000..752c9b3c617
--- /dev/null
+++ b/pkgs/applications/networking/cluster/clusterctl/default.nix
@@ -0,0 +1,41 @@
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
+
+buildGoModule rec {
+  pname = "clusterctl";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "kubernetes-sigs";
+    repo = "cluster-api";
+    rev = "v${version}";
+    sha256 = "sha256-EkBZZUkr1u0u75WDDFAdLLpS01+3+eyXpu4HRg2Q780=";
+  };
+
+  vendorSha256 = "sha256-VO1Z4NUWrd4JuFYFg0a01psqoIM8ps3vKd0djR5OELU=";
+
+  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=$(mktemp -d)
+
+    installShellCompletion --cmd clusterctl \
+      --bash <($out/bin/clusterctl completion bash) \
+      --zsh <($out/bin/clusterctl completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "Kubernetes cluster API tool";
+    homepage = "https://cluster-api.sigs.k8s.io/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ zowoq ];
+  };
+}