Files
nixpkgs/pkgs/by-name/yg/ygot/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

60 lines
1.5 KiB
Nix

{
lib,
stdenv,
buildPackages,
buildGoModule,
fetchFromGitHub,
installShellFiles,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "ygot";
version = "0.34.0";
src = fetchFromGitHub {
owner = "openconfig";
repo = "ygot";
tag = "v${finalAttrs.version}";
hash = "sha256-/dE3IsooCuIi3e+1RRA50wKB2NE8ohf46wFqZcdFKq0=";
};
vendorHash = "sha256-66hugAa31RWQxGNsVpfyLzZoXbW7KQ73ggvvInn8dw8=";
excludedPackages = [
"demo/*"
"exampleoc"
"integration_tests/"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
# The normal binary names are far too generic
mv $out/bin/generator $out/bin/ygot_generator
mv $out/bin/proto_generator $out/bin/ygot_proto_generator
''
+ lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd gnmidiff \
--bash <(${emulator} $out/bin/gnmidiff completion bash) \
--zsh <(${emulator} $out/bin/gnmidiff completion zsh) \
--fish <(${emulator} $out/bin/gnmidiff completion fish)
''
);
passthru.updateScript = nix-update-script { };
meta = {
description = "Collection of Go utilities for interacting with YANG modules";
homepage = "https://github.com/openconfig/ygot";
changelog = "https://github.com/openconfig/ygot/releases/tag/v${finalAttrs.version}";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.haylin ];
mainProgram = "ygot_generator";
};
})