1{
2 fetchFromGitHub,
3 lib,
4 libkrb5,
5 openssl,
6 postgresql,
7 postgresqlBuildExtension,
8}:
9
10let
11 source =
12 {
13 "17" = {
14 version = "17.0";
15 hash = "sha256-3ksq09wiudQPuBQI3dhEQi8IkXKLVIsPFgBnwLiicro=";
16 };
17 "16" = {
18 version = "16.0";
19 hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc=";
20 };
21 "15" = {
22 version = "1.7.0";
23 hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw=";
24 };
25 "14" = {
26 version = "1.6.2";
27 hash = "sha256-Bl7Jk2B0deZUDiI391vk4nilwuVGHd1wuaQRSCoA3Mk=";
28 };
29 "13" = {
30 version = "1.5.2";
31 hash = "sha256-fyf2Ym0fAAXjc28iFCGDEftPAyDLXmEgi/0DaTJJiIg=";
32 };
33 }
34 .${lib.versions.major postgresql.version}
35 or (throw "Source for pgaudit is not available for ${postgresql.version}");
36in
37postgresqlBuildExtension {
38 pname = "pgaudit";
39 inherit (source) version;
40
41 src = fetchFromGitHub {
42 owner = "pgaudit";
43 repo = "pgaudit";
44 tag = source.version;
45 hash = source.hash;
46 };
47
48 buildInputs = [
49 libkrb5
50 openssl
51 ];
52
53 makeFlags = [ "USE_PGXS=1" ];
54
55 enableUpdateScript = false;
56
57 meta = {
58 description = "Open Source PostgreSQL Audit Logging";
59 homepage = "https://github.com/pgaudit/pgaudit";
60 changelog = "https://github.com/pgaudit/pgaudit/releases/tag/${source.version}";
61 maintainers = with lib.maintainers; [ idontgetoutmuch ];
62 platforms = postgresql.meta.platforms;
63 license = lib.licenses.postgresql;
64 };
65}