From 41eb16ac0e09ea277e7e24a9e8e1694980dd5658 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 23 Sep 2024 10:54:52 -0400 Subject: [PATCH 1/2] feat: update pgaudit to handle pg versions 15 and 16 --- nix/ext/pgaudit.nix | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/nix/ext/pgaudit.nix b/nix/ext/pgaudit.nix index c3df061ff..a2ea1a747 100644 --- a/nix/ext/pgaudit.nix +++ b/nix/ext/pgaudit.nix @@ -1,14 +1,26 @@ { lib, stdenv, fetchFromGitHub, libkrb5, openssl, postgresql }: - -stdenv.mkDerivation rec { +#adapted from https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/ext/pgaudit.nix +let + source = { + "16" = { + version = "16.0"; + hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc="; + }; + "15" = { + version = "1.7.0"; + hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw="; + }; + }.${lib.versions.major postgresql.version} or (throw "Source for pgaudit is not available for ${postgresql.version}"); +in +stdenv.mkDerivation { pname = "pgaudit"; - version = "1.7.0"; + inherit (source) version; src = fetchFromGitHub { owner = "pgaudit"; repo = "pgaudit"; - rev = "${version}"; - hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw="; + rev = source.version; + hash = source.hash; }; buildInputs = [ libkrb5 openssl postgresql ]; @@ -25,8 +37,8 @@ stdenv.mkDerivation rec { description = "Open Source PostgreSQL Audit Logging"; homepage = "https://github.com/pgaudit/pgaudit"; changelog = "https://github.com/pgaudit/pgaudit/releases/tag/${source.version}"; - maintainers = with maintainers; [ idontgetoutmuch ]; + maintainers = with maintainers; [ samrose ]; platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} +} \ No newline at end of file From 8c2cd762d773f74a2a20164d0bf0117e7bc847c2 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 24 Sep 2024 11:45:55 -0400 Subject: [PATCH 2/2] fix: newline --- nix/ext/pgaudit.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/ext/pgaudit.nix b/nix/ext/pgaudit.nix index a2ea1a747..f6c5d8bb0 100644 --- a/nix/ext/pgaudit.nix +++ b/nix/ext/pgaudit.nix @@ -41,4 +41,4 @@ stdenv.mkDerivation { platforms = postgresql.meta.platforms; license = licenses.postgresql; }; -} \ No newline at end of file +}