Files
nixpkgs/pkgs/by-name/ku/kubeshark/package.nix
2026-07-13 20:17:38 +08:00

82 lines
2.1 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
stdenv,
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
kubeshark,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "kubeshark";
version = "53.3.0";
src = fetchFromGitHub {
owner = "kubeshark";
repo = "kubeshark";
tag = "v${finalAttrs.version}";
hash = "sha256-YKR0P/4X134NTPuXeh1Ha781wav7daAxp+xJWCmgkIw=";
};
vendorHash = "sha256-4s1gxJo2w5BibZ9CJP7Jl9Z8Zzo8WpBokBnRN+zp8b4=";
ldflags =
let
t = "github.com/kubeshark/kubeshark";
in
[
"-s"
"-w"
"-X ${t}/misc.GitCommitHash=${finalAttrs.src.tag}"
"-X ${t}/misc.Branch=master"
"-X ${t}/misc.BuildTimestamp=0"
"-X ${t}/misc.Platform=unknown"
"-X ${t}/misc.Ver=${finalAttrs.version}"
];
nativeBuildInputs = [ installShellFiles ];
checkPhase = ''
go test ./...
'';
doCheck = true;
# Tests bind loopback sockets via httptest.
__darwinAllowLocalNetworking = true;
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubeshark \
--bash <($out/bin/kubeshark completion bash) \
--fish <($out/bin/kubeshark completion fish) \
--zsh <($out/bin/kubeshark completion zsh)
'';
passthru = {
tests.version = testers.testVersion {
package = kubeshark;
command = "kubeshark version";
inherit (finalAttrs) version;
};
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/kubeshark/kubeshark/releases/tag/v${finalAttrs.version}";
description = "API Traffic Viewer for Kubernetes";
mainProgram = "kubeshark";
homepage = "https://kubeshark.com/";
license = lib.licenses.asl20;
longDescription = ''
The API traffic viewer for Kubernetes providing real-time, protocol-aware visibility into Kubernetes’ internal network,
Think TCPDump and Wireshark re-invented for Kubernetes
capturing, dissecting and monitoring all traffic and payloads going in, out and across containers, pods, nodes and clusters.
'';
maintainers = with lib.maintainers; [
qjoly
miniharinn
];
};
})