blob: 20bba7d405dcf414887cfc25c017a4757fdf3869 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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.8.1";
tags = lib.optionals enableGateway ["gateway"];
vendorSha256 = "sha256-69uXHvpQMeFwQbejMpfQPS8DDXJyVsnn59WUEJpSeng=";
src = fetchFromGitHub {
owner = "kumahq";
repo = "kuma";
rev = version;
sha256 = "sha256-hNfgiMX3aMb8yjXjFKz73MczOeJyOI3Tna/NRSJBSzs=";
};
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 ];
};
}
|