diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-06-06 09:57:14 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-06-06 09:57:14 +0200 |
commit | 0457c307872f1d92d1c3dc0592f7fae0bb174a8c (patch) | |
tree | 15de31345ea1be931a6689e640882dd8f6a93022 /modules/apps | |
parent | 2319772f807508b1dedd19e14634bfdffd855ab3 (diff) | |
download | nixsap-0457c307872f1d92d1c3dc0592f7fae0bb174a8c.tar.gz |
Allow a postgres package per pg_dump command
To improve modularity.
Diffstat (limited to 'modules/apps')
-rw-r--r-- | modules/apps/pgbackup.nix | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/apps/pgbackup.nix b/modules/apps/pgbackup.nix index a0c1f56..420e72e 100644 --- a/modules/apps/pgbackup.nix +++ b/modules/apps/pgbackup.nix @@ -29,6 +29,7 @@ let command = sub { + package = default pkgs.postgresql package; blobs = optional bool; clean = optional bool; compress = default 9 int; @@ -65,6 +66,7 @@ let args = filterAttrs (n: v: v != null && n != "_module" + && n != "package" && (n == "host" -> v != "localhost") && (n == "jobs" -> o.format == "directory") # XXX will use pigz for others: @@ -77,10 +79,9 @@ let else if isString v then "--${k}='${v}'" else "--${k}=${toString v}" ; - # XXX: Use the latest pg_dump: pg_dump = pkgs.writeBashScript name '' ${optionalString (cfg.pgpass != null) "export PGPASSFILE='${cfg.pgpass}'"} - exec ${cfg.package}/bin/pg_dump \ + exec ${o.package}/bin/pg_dump \ ${concatMapAttrsSep " " mkArg args} \ "$@" ''; @@ -257,12 +258,6 @@ let in { options.nixsap.apps.pgbackup = { - package = mkOption { - description = "PostgreSQL package providing pg_dump"; - type = package; - default = pkgs.postgresql; - }; - user = mkOption { description = "User to run as"; default = "pgbackup"; |