From ab08c8a1bb745b71aabfc8f79f3882987c9f9811 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 14 Jul 2013 05:04:10 +0200 Subject: [PATCH] postgresql: Allow to specify recoveryConfig. This is needed for streaming replication in PostgreSQL 9.0 and higher. Signed-off-by: aszlig --- modules/services/databases/postgresql.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/services/databases/postgresql.nix b/modules/services/databases/postgresql.nix index bd1eaa5e6bd..de03fe1e46e 100644 --- a/modules/services/databases/postgresql.nix +++ b/modules/services/databases/postgresql.nix @@ -129,6 +129,14 @@ in default = ""; description = "Additional text to be appended to postgresql.conf."; }; + + recoveryConfig = mkOption { + default = null; + type = types.nullOr types.string; + description = '' + Values to put into recovery.conf file. + ''; + }; }; }; @@ -177,7 +185,11 @@ in touch "${cfg.dataDir}/.first_startup" fi - ln -sfn ${configFile} ${cfg.dataDir}/postgresql.conf + ln -sfn "${configFile}" "${cfg.dataDir}/postgresql.conf" + ${optionalString (cfg.recoveryConfig != null) '' + ln -sfn "${pkgs.writeText "recovery.conf" cfg.recoveryConfig}" \ + "${cfg.dataDir}/recovery.conf" + ''} ''; # */ serviceConfig =