Skip to content

Commit f0c79f2

Browse files
committed
feat: package 2.0.1 wal-g with nix instead
1 parent 52115b9 commit f0c79f2

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

Dockerfile-15

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ ARG wal_g_release
122122
# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-24.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz
123123
RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \
124124
apt-get update && apt-get install -y --no-install-recommends curl && \
125-
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-24.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
125+
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
126126
tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
127127
rm -rf /tmp/wal-g.tar.gz && \
128-
mv /tmp/wal-g-pg-ubuntu*24.04-aarch64 /tmp/wal-g
128+
mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g
129129

130130
# ####################
131131
# # Download gosu for easy step-down from root

Dockerfile-158

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ ARG wal_g_release
122122
# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-24.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz
123123
RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \
124124
apt-get update && apt-get install -y --no-install-recommends curl && \
125-
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-24.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
125+
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
126126
tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
127127
rm -rf /tmp/wal-g.tar.gz && \
128-
mv /tmp/wal-g-pg-ubuntu*24.04-aarch64 /tmp/wal-g
128+
mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g
129129

130130
# ####################
131131
# # Download gosu for easy step-down from root

Dockerfile-orioledb-17

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ ARG wal_g_release
121121
# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-24.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz
122122
RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \
123123
apt-get update && apt-get install -y --no-install-recommends curl && \
124-
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-24.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
124+
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
125125
tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
126126
rm -rf /tmp/wal-g.tar.gz && \
127-
mv /tmp/wal-g-pg-ubuntu*24.04-aarch64 /tmp/wal-g
127+
mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g
128128

129129
# ####################
130130
# # Download gosu for easy step-down from root

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
@@ -399,6 +400,7 @@
399400
psql_orioledb-17 = postgresVersions.psql_orioledb-17;
400401
sfcgal = sfcgal;
401402
pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP;
403+
wal-g = wal-g;
402404
inherit postgresql_15 postgresql_orioledb-17;
403405
postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null;
404406
postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null;

nix/wal-g.nix

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{ lib, buildGoModule, fetchFromGitHub, brotli, libsodium, installShellFiles }:
2+
3+
buildGoModule 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+
vendorHash = "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+
}

0 commit comments

Comments
 (0)