Files
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

77 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
buildGoModule,
coredns,
installShellFiles,
isFull ? false,
enableGateway ? false,
pname ? "kuma",
components ? lib.optionals isFull [
"kumactl"
"kuma-cp"
"kuma-dp"
],
}:
buildGoModule rec {
inherit pname;
version = "2.12.0";
tags = lib.optionals enableGateway [ "gateway" ];
src = fetchFromGitHub {
owner = "kumahq";
repo = "kuma";
tag = version;
hash = "sha256-5syQFcYBY/xKipIsAJdjVrXYXt7NNjjCeXiDVNO9NTo=";
};
vendorHash = "sha256-KgZYKopW+FOdwBIGxa2RLiEbefZ/1vAhcsWtcYhgdFs=";
# no test files
doCheck = false;
nativeBuildInputs = [ installShellFiles ] ++ lib.optionals isFull [ coredns ];
preBuild = ''
export HOME=$TMPDIR
'';
subPackages = map (p: "app/" + p) components;
postInstall =
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
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 = {
description = "Service mesh controller";
homepage = "https://kuma.io/";
changelog = "https://github.com/kumahq/kuma/blob/${version}/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ zbioe ];
};
}