diff options
author | Maximilian Bosch <mb@flyingcircus.io> | 2024-03-13 14:36:20 +0100 |
---|---|---|
committer | Maximilian Bosch <mb@flyingcircus.io> | 2024-03-13 16:15:54 +0100 |
commit | 0cdaede1444c143b411ebcb203b1a7d2f97a3949 (patch) | |
tree | 5d2c6c506ae79cd761a088e43fe6bfc532fc0b8f /pkgs/by-name/pg | |
parent | 8d0e5a3402aabe9a749913d9028b54bad4da32ab (diff) |
pg-dump-anon: init at 1.3.1
This is a Go program inside the sources of `postgresql_anonymizer` that allows to perform database dumps, but with anonymized data. I figured that it's a little awkward to have a client program to be part of the extension package. So I decided to create a second package called `pg-dump-anon`. Since it's one repository, both share `version` & `src`. Also extended the VM test to make sure we're getting properly anonymized data when dumping with `pg_dump_anon`.
Diffstat (limited to 'pkgs/by-name/pg')
-rw-r--r-- | pkgs/by-name/pg/pg-dump-anon/package.nix | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/by-name/pg/pg-dump-anon/package.nix b/pkgs/by-name/pg/pg-dump-anon/package.nix new file mode 100644 index 0000000000000..fedcf9f40b6a7 --- /dev/null +++ b/pkgs/by-name/pg/pg-dump-anon/package.nix @@ -0,0 +1,32 @@ +{ lib, fetchFromGitLab, buildGoModule, nixosTests, postgresql, makeWrapper }: + +buildGoModule rec { + pname = "pg-dump-anon"; + version = "1.3.1"; + src = fetchFromGitLab { + owner = "dalibo"; + repo = "postgresql_anonymizer"; + rev = version; + hash = "sha256-Z5Oz/cIYDxFUZwQijRk4xAOUdOK0LWR+px8WOcs+Rs0="; + }; + + sourceRoot = "${src.name}/pg_dump_anon"; + + vendorHash = "sha256-CwU1zoIayxvfnGL9kPdummPJiV+ECfSz4+q6gZGb8pw="; + + passthru.tests = { inherit (nixosTests) pg_anonymizer; }; + + nativeBuildInputs = [ makeWrapper ]; + postInstall = '' + wrapProgram $out/bin/pg_dump_anon \ + --prefix PATH : ${lib.makeBinPath [ postgresql ]} + ''; + + meta = with lib; { + description = "Export databases with data being anonymized with the anonymizer extension"; + homepage = "https://postgresql-anonymizer.readthedocs.io/en/stable/"; + maintainers = teams.flyingcircus.members; + license = licenses.postgresql; + mainProgram = "pg_dump_anon"; + }; +} |