Files
nixpkgs/pkgs/by-name/gn/gnmic/package.nix
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

56 lines
1.3 KiB
Nix

{
stdenv,
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
buildPackages,
}:
buildGoModule rec {
pname = "gnmic";
version = "0.42.0";
src = fetchFromGitHub {
owner = "openconfig";
repo = "gnmic";
tag = "v${version}";
hash = "sha256-qN5EnZR1sXni2m1nyH61xLIX7c9sk5SGtAxrolfNHzs=";
};
vendorHash = "sha256-QHqsL2XMkIB+CN7uXdn3gpVoaxEfDjdf1ADhd/bYVis=";
ldflags = [
"-s"
"-w"
"-X"
"github.com/openconfig/gnmic/pkg/app.version=${version}"
"-X"
"github.com/openconfig/gnmic/pkg/app.commit=${src.rev}"
"-X"
"github.com/openconfig/gnmic/pkg/app.date=1970-01-01T00:00:00Z"
];
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
postInstall =
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd gnmic \
--bash <(${emulator} $out/bin/gnmic completion bash) \
--fish <(${emulator} $out/bin/gnmic completion fish) \
--zsh <(${emulator} $out/bin/gnmic completion zsh)
'';
meta = with lib; {
description = "gNMI CLI client and collector";
homepage = "https://gnmic.openconfig.net/";
changelog = "https://github.com/openconfig/gnmic/releases/tag/${src.rev}";
license = licenses.asl20;
maintainers = with maintainers; [ vincentbernat ];
mainProgram = "gnmic";
};
}