Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitHub, brotli, libsodium, installShellFiles }: 2 3buildGoModule rec { 4 pname = "wal-g"; 5 version = "2.0.1"; 6 7 src = fetchFromGitHub { 8 owner = "wal-g"; 9 repo = "wal-g"; 10 rev = "v${version}"; 11 sha256 = "sha256-5mwA55aAHwEFabGZ6c3pi8NLcYofvoe4bb/cFj7NWok="; 12 }; 13 14 vendorSha256 = "sha256-BbQuY6r30AkxlCZjY8JizaOrqEBdv7rIQet9KQwYB/g="; 15 16 nativeBuildInputs = [ installShellFiles ]; 17 18 buildInputs = [ brotli libsodium ]; 19 20 subPackages = [ "main/pg" ]; 21 22 tags = [ "brotli" "libsodium" ]; 23 24 ldflags = [ "-s" "-w" "-X github.com/wal-g/wal-g/cmd/pg.WalgVersion=${version}" "-X github.com/wal-g/wal-g/cmd/pg.GitRevision=${src.rev}" ]; 25 26 postInstall = '' 27 mv $out/bin/pg $out/bin/wal-g 28 installShellCompletion --cmd wal-g \ 29 --bash <($out/bin/wal-g completion bash) \ 30 --zsh <($out/bin/wal-g completion zsh) 31 ''; 32 33 meta = with lib; { 34 homepage = "https://github.com/wal-g/wal-g"; 35 license = licenses.asl20; 36 description = "An archival restoration tool for PostgreSQL"; 37 maintainers = with maintainers; [ marsam ]; 38 }; 39}