aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-06-06 09:57:14 +0200
committerIgor Pashev <pashev.igor@gmail.com>2019-06-06 09:57:14 +0200
commit0457c307872f1d92d1c3dc0592f7fae0bb174a8c (patch)
tree15de31345ea1be931a6689e640882dd8f6a93022
parent2319772f807508b1dedd19e14634bfdffd855ab3 (diff)
downloadnixsap-0457c307872f1d92d1c3dc0592f7fae0bb174a8c.tar.gz
Allow a postgres package per pg_dump command
To improve modularity.
-rw-r--r--modules/apps/pgbackup.nix11
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";