Skip to content

Commit ee40b98

Browse files
authored
feat: update pgaudit to handle pg versions 15 and 16 (supabase#1228)
* feat: update pgaudit to handle pg versions 15 and 16 * fix: newline --------- Co-authored-by: Sam Rose <[email protected]>
1 parent bf5d2e8 commit ee40b98

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

nix/ext/pgaudit.nix

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
{ lib, stdenv, fetchFromGitHub, libkrb5, openssl, postgresql }:
2-
3-
stdenv.mkDerivation rec {
2+
#adapted from https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/ext/pgaudit.nix
3+
let
4+
source = {
5+
"16" = {
6+
version = "16.0";
7+
hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc=";
8+
};
9+
"15" = {
10+
version = "1.7.0";
11+
hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw=";
12+
};
13+
}.${lib.versions.major postgresql.version} or (throw "Source for pgaudit is not available for ${postgresql.version}");
14+
in
15+
stdenv.mkDerivation {
416
pname = "pgaudit";
5-
version = "1.7.0";
17+
inherit (source) version;
618

719
src = fetchFromGitHub {
820
owner = "pgaudit";
921
repo = "pgaudit";
10-
rev = "${version}";
11-
hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw=";
22+
rev = source.version;
23+
hash = source.hash;
1224
};
1325

1426
buildInputs = [ libkrb5 openssl postgresql ];
@@ -25,7 +37,7 @@ stdenv.mkDerivation rec {
2537
description = "Open Source PostgreSQL Audit Logging";
2638
homepage = "https://github.com/pgaudit/pgaudit";
2739
changelog = "https://github.com/pgaudit/pgaudit/releases/tag/${source.version}";
28-
maintainers = with maintainers; [ idontgetoutmuch ];
40+
maintainers = with maintainers; [ samrose ];
2941
platforms = postgresql.meta.platforms;
3042
license = licenses.postgresql;
3143
};

0 commit comments

Comments
 (0)