Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildGoModule, 4 fetchFromGitHub, 5 installShellFiles, 6 stdenv, 7}: 8 9buildGoModule rec { 10 pname = "pathvector"; 11 version = "6.3.2"; 12 13 src = fetchFromGitHub { 14 owner = "natesales"; 15 repo = "pathvector"; 16 rev = "v${version}"; 17 sha256 = "sha256-TqGasguEAcA5ET2E/uFjgIl7IHI2v9m5EaXpIMG3T8c="; 18 }; 19 20 nativeBuildInputs = [ installShellFiles ]; 21 22 vendorHash = "sha256-hgUuntT6jMWI14qDE3Yjm5W8UqQ6CcvoILmSDaVEZac="; 23 24 env.CGO_ENABLED = 0; 25 26 ldflags = [ 27 "-s" 28 "-w" 29 "-X main.version=${version}" 30 "-X main.commit=${src.rev}" 31 "-X main.date=unknown" 32 ]; 33 34 doCheck = false; 35 36 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 37 local INSTALL="$out/bin/pathvector" 38 installShellCompletion --cmd pathvector \ 39 --bash <($out/bin/pathvector completion bash) \ 40 --fish <($out/bin/pathvector completion fish) \ 41 --zsh <($out/bin/pathvector completion zsh) 42 ''; 43 44 meta = with lib; { 45 description = "Declarative edge routing platform that automates route optimization and control plane configuration"; 46 homepage = "https://pathvector.io"; 47 license = licenses.gpl3; 48 maintainers = with maintainers; [ matthewpi ]; 49 mainProgram = "pathvector"; 50 }; 51}