Skip to content

Commit f239151

Browse files
committed
feature: wal-g v 3
1 parent fc59218 commit f239151

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
sfcgal = pkgs.callPackage ./nix/ext/sfcgal/sfcgal.nix { };
8080
supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { };
8181
mecab-naist-jdic = pkgs.callPackage ./nix/ext/mecab-naist-jdic/default.nix { };
82+
wal-g = pkgs.callPackage ./nix/wal-g.nix { };
8283
# Our list of PostgreSQL extensions which come from upstream Nixpkgs.
8384
# These are maintained upstream and can easily be used here just by
8485
# listing their name. Anytime the version of nixpkgs is upgraded, these
@@ -397,6 +398,7 @@
397398
# PostgreSQL versions.
398399
psql_15 = postgresVersions.psql_15;
399400
psql_orioledb-17 = postgresVersions.psql_orioledb-17;
401+
wal-g = wal-g;
400402
sfcgal = sfcgal;
401403
pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP;
402404
inherit postgresql_15 postgresql_orioledb-17;

nix/wal-g.nix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
lib,
3+
buildGoModule,
4+
fetchFromGitHub,
5+
brotli,
6+
libsodium,
7+
installShellFiles,
8+
}:
9+
10+
buildGoModule rec {
11+
pname = "wal-g";
12+
version = "3.0.5";
13+
14+
src = fetchFromGitHub {
15+
owner = "wal-g";
16+
repo = "wal-g";
17+
rev = "v${version}";
18+
sha256 = "sha256-wVr0L2ZXMuEo6tc2ajNzPinVQ8ZVzNOSoaHZ4oFsA+U=";
19+
};
20+
21+
vendorHash = "sha256-YDLAmRfDl9TgbabXj/1rxVQ052NZDg3IagXVTe5i9dw=";
22+
23+
nativeBuildInputs = [ installShellFiles ];
24+
25+
buildInputs = [
26+
brotli
27+
libsodium
28+
];
29+
30+
subPackages = [ "main/pg" ];
31+
32+
tags = [
33+
"brotli"
34+
"libsodium"
35+
];
36+
37+
ldflags = [
38+
"-s"
39+
"-w"
40+
"-X github.com/wal-g/wal-g/cmd/pg.walgVersion=${version}"
41+
"-X github.com/wal-g/wal-g/cmd/pg.gitRevision=${src.rev}"
42+
];
43+
44+
postInstall = ''
45+
mv $out/bin/pg $out/bin/wal-g
46+
installShellCompletion --cmd wal-g \
47+
--bash <($out/bin/wal-g completion bash) \
48+
--zsh <($out/bin/wal-g completion zsh)
49+
'';
50+
51+
meta = with lib; {
52+
homepage = "https://github.com/wal-g/wal-g";
53+
license = licenses.asl20;
54+
description = "Archival restoration tool for PostgreSQL";
55+
mainProgram = "wal-g";
56+
maintainers = [ ];
57+
};
58+
}

0 commit comments

Comments
 (0)