Files
nixpkgs/pkgs/applications/networking/cluster/linkerd/generic.nix
Luna Nova ca6a37f817 linkerd: remove unnecessary buildmode=pie
This is no longer needed now that our go produces PIE by default
2025-10-07 20:27:45 -07:00

77 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
buildGoModule,
installShellFiles,
}:
{
channel,
version,
sha256,
vendorHash,
}:
buildGoModule rec {
pname = "linkerd-${channel}";
inherit version vendorHash;
src = fetchFromGitHub {
owner = "linkerd";
repo = "linkerd2";
rev = "${channel}-${version}";
inherit sha256;
};
subPackages = [ "cli" ];
preBuild = ''
env GOFLAGS="" go generate ./pkg/charts/static
env GOFLAGS="" go generate ./jaeger/static
env GOFLAGS="" go generate ./multicluster/static
env GOFLAGS="" go generate ./viz/static
'';
tags = [
"prod"
];
ldflags = [
"-s"
"-w"
"-X github.com/linkerd/linkerd2/pkg/version.Version=${src.rev}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
mv $out/bin/cli $out/bin/linkerd
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd linkerd \
--bash <($out/bin/linkerd completion bash) \
--zsh <($out/bin/linkerd completion zsh) \
--fish <($out/bin/linkerd completion fish)
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/linkerd version --client | grep ${src.rev} > /dev/null
'';
passthru.updateScript = (./. + "/update-${channel}.sh");
meta = with lib; {
description = "Simple Kubernetes service mesh that improves security, observability and reliability";
mainProgram = "linkerd";
downloadPage = "https://github.com/linkerd/linkerd2/";
homepage = "https://linkerd.io/";
license = licenses.asl20;
maintainers = with maintainers; [
bryanasdev000
Gonzih
];
};
}