From c60adb947e363a915e057244cfd1c2d61fa22d9a Mon Sep 17 00:00:00 2001 From: iury fukuda Date: Wed, 17 Nov 2021 19:42:30 -0300 Subject: [PATCH] kuma: init at 1.4.0 --- .../networking/cluster/kuma/default.nix | 65 +++++++++++++++++++ .../networking/cluster/kumactl/default.nix | 34 ---------- pkgs/top-level/all-packages.nix | 23 ++++++- 3 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 pkgs/applications/networking/cluster/kuma/default.nix delete mode 100644 pkgs/applications/networking/cluster/kumactl/default.nix diff --git a/pkgs/applications/networking/cluster/kuma/default.nix b/pkgs/applications/networking/cluster/kuma/default.nix new file mode 100644 index 000000000000..d7a58f09b4e7 --- /dev/null +++ b/pkgs/applications/networking/cluster/kuma/default.nix @@ -0,0 +1,65 @@ +{ lib +, fetchFromGitHub +, buildGoModule +, coredns +, installShellFiles +, isFull ? false +, enableGateway ? false +, pname ? "kuma" +, components ? lib.optionals isFull [ + "kumactl" + "kuma-cp" + "kuma-prometheus-sd" + "kuma-dp" + ] +}: + +buildGoModule rec { + inherit pname ; + version = "1.4.0"; + tags = lib.optionals enableGateway ["gateway"]; + vendorSha256 = "1fc5psvbd9bpc6c3y2cpx5dx8cgr2fcp7nln3kwfgbryahq2y8wl"; + + src = fetchFromGitHub { + owner = "kumahq"; + repo = "kuma"; + rev = version; + sha256 = "0agib3w5s270n5rhg54m3p4f21s5fhdrhaks374j7l21njs7xhqb"; + }; + + doCheck = false; + + nativeBuildInputs = [installShellFiles] ++ lib.optionals isFull [coredns]; + + preBuild = '' + export HOME=$TMPDIR + ''; + + subPackages = map (p: "app/" + p) components; + + postInstall = lib.concatMapStringsSep "\n" (p: '' + installShellCompletion --cmd ${p} \ + --bash <($out/bin/${p} completion bash) \ + --fish <($out/bin/${p} completion fish) \ + --zsh <($out/bin/${p} completion zsh) + '') components + lib.optionalString isFull '' + ln -sLf ${coredns}/bin/coredns $out/bin + ''; + + ldflags = let + prefix = "github.com/kumahq/kuma/pkg/version"; + in [ + "-s" "-w" + "-X ${prefix}.version=${version}" + "-X ${prefix}.gitTag=${version}" + "-X ${prefix}.gitCommit=${version}" + "-X ${prefix}.buildDate=${version}" + ]; + + meta = with lib; { + description = "Service mesh controller"; + homepage = "https://kuma.io/"; + license = licenses.asl20; + maintainers = with maintainers; [ zbioe ]; + }; +} diff --git a/pkgs/applications/networking/cluster/kumactl/default.nix b/pkgs/applications/networking/cluster/kumactl/default.nix deleted file mode 100644 index d13db27444fb..000000000000 --- a/pkgs/applications/networking/cluster/kumactl/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ lib, fetchFromGitHub, buildGoModule }: - -buildGoModule rec { - pname = "kumactl"; - version = "1.3.1"; - - src = fetchFromGitHub { - owner = "kumahq"; - repo = "kuma"; - rev = version; - sha256 = "0b554cngg2j3wnadpqwhq3dv3la8vvvzyww2diw4il4gl4j6xj0j"; - }; - - vendorSha256 = "0r26h4vp11wbl7nk3y7c22p60q7lspy8nr58khxyczdqjk6wrdjp"; - - subPackages = [ "app/kumactl" ]; - - ldflags = let - prefix = "github.com/kumahq/kuma/pkg/version"; - in [ - "-s" "-w" - "-X ${prefix}.version=${version}" - "-X ${prefix}.gitTag=${version}" - "-X ${prefix}.gitCommit=${version}" - "-X ${prefix}.buildDate=${version}" - ]; - - meta = with lib; { - description = "Kuma service mesh controller"; - homepage = "https://kuma.io/"; - license = licenses.asl20; - maintainers = with maintainers; [ zbioe ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4c6b850e8f57..0b40bb0bb1cc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26275,7 +26275,28 @@ with pkgs; linkerd_edge = callPackage ../applications/networking/cluster/linkerd/edge.nix { }; linkerd_stable = linkerd; - kumactl = callPackage ../applications/networking/cluster/kumactl { }; + kuma = callPackage ../applications/networking/cluster/kuma { isFull = true; }; + kuma-experimental = callPackage ../applications/networking/cluster/kuma { + isFull = true; + enableGateway = true; + pname = "kuma-experimental"; + }; + kumactl = callPackage ../applications/networking/cluster/kuma { + components = ["kumactl"]; + pname = "kumactl"; + }; + kuma-cp = callPackage ../applications/networking/cluster/kuma { + components = ["kuma-cp"]; + pname = "kuma-cp"; + }; + kuma-dp = callPackage ../applications/networking/cluster/kuma { + components = ["kuma-dp"]; + pname = "kuma-dp"; + }; + kuma-prometheus-sd = callPackage ../applications/networking/cluster/kuma { + components = ["kuma-prometheus-sd"]; + pname = "kuma-prometheus-sd"; + }; kile-wl = callPackage ../applications/misc/kile-wl { };