nixpkgs/pkgs/applications/networking/cluster/kubeshark/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

62 lines
1.9 KiB
Nix
Raw 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 rec {
pname = "kubeshark";
version = "52.1.75";
src = fetchFromGitHub {
owner = "kubeshark";
repo = "kubeshark";
rev = "v${version}";
hash = "sha256-3DKoYjAOYucK28D68GeM1S1kTxec9eMYFY6zQ8dZKNo=";
};
vendorHash = "sha256-SmvO9DYOXxnmN2dmHPPOguVwEbWSH/xNLBB+idpzopo=";
ldflags = let t = "github.com/kubeshark/kubeshark"; in [
"-s" "-w"
"-X ${t}/misc.GitCommitHash=${src.rev}"
"-X ${t}/misc.Branch=master"
"-X ${t}/misc.BuildTimestamp=0"
"-X ${t}/misc.Platform=unknown"
"-X ${t}/misc.Ver=${version}"
];
nativeBuildInputs = [ installShellFiles ];
checkPhase = ''
go test ./...
'';
doCheck = true;
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
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 version;
};
updateScript = nix-update-script { };
};
meta = with lib; {
changelog = "https://github.com/kubeshark/kubeshark/releases/tag/${version}";
description = "The API Traffic Viewer for Kubernetes";
mainProgram = "kubeshark";
homepage = "https://kubeshark.co/";
license = 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 maintainers; [ bryanasdev000 qjoly ];
};
}