0cdaede144
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`.
32 lines
970 B
Nix
32 lines
970 B
Nix
{ 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";
|
|
};
|
|
}
|