nixpkgs/pkgs/by-name/hu/hubble/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

49 lines
1.4 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "hubble";
version = "0.13.6";
src = fetchFromGitHub {
owner = "cilium";
repo = pname;
rev = "v${version}";
sha256 = "sha256-evtXuVcaKKuAW+04S+IADKf+wJ1MrnGpHLNUbxWd9ZM=";
};
vendorHash = null;
ldflags = [
"-s" "-w"
"-X github.com/cilium/hubble/pkg.GitBranch=none"
"-X github.com/cilium/hubble/pkg.GitHash=none"
"-X github.com/cilium/hubble/pkg.Version=${version}"
];
# Test fails at Test_getFlowsRequestWithInvalidRawFilters in github.com/cilium/hubble/cmd/observe
# https://github.com/NixOS/nixpkgs/issues/178976
# https://github.com/cilium/hubble/pull/656
# https://github.com/cilium/hubble/pull/655
doCheck = false;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/hubble version | grep ${version} > /dev/null
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd hubble \
--bash <($out/bin/hubble completion bash) \
--fish <($out/bin/hubble completion fish) \
--zsh <($out/bin/hubble completion zsh)
'';
meta = with lib; {
description = "Network, Service & Security Observability for Kubernetes using eBPF";
mainProgram = "hubble";
license = licenses.asl20;
homepage = "https://github.com/cilium/hubble/";
maintainers = with maintainers; [ humancalico bryanasdev000 ];
};
}