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

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

66 lines
1.5 KiB
Nix
Raw Normal View History

2021-11-17 22:42:30 +00:00
{ lib
, fetchFromGitHub
, buildGoModule
2021-11-17 22:42:30 +00:00
, coredns
, installShellFiles
, isFull ? false
, enableGateway ? false
, pname ? "kuma"
, components ? lib.optionals isFull [
"kumactl"
"kuma-cp"
"kuma-prometheus-sd"
"kuma-dp"
]
}:
buildGoModule rec {
2021-11-17 22:42:30 +00:00
inherit pname ;
2022-10-11 00:38:43 +00:00
version = "1.8.1";
2021-11-17 22:42:30 +00:00
tags = lib.optionals enableGateway ["gateway"];
2022-08-28 19:30:34 +00:00
vendorSha256 = "sha256-69uXHvpQMeFwQbejMpfQPS8DDXJyVsnn59WUEJpSeng=";
2021-11-17 22:42:30 +00:00
src = fetchFromGitHub {
owner = "kumahq";
repo = "kuma";
rev = version;
2022-10-11 00:38:43 +00:00
sha256 = "sha256-hNfgiMX3aMb8yjXjFKz73MczOeJyOI3Tna/NRSJBSzs=";
2021-11-17 22:42:30 +00:00
};
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 ];
};
}