From d44206d2c470515e1c9d5fc55731f82c4feb9e74 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Fri, 15 May 2009 08:00:20 +0000 Subject: [PATCH] * Synced with trunk @ 15391 svn path=/nixos/branches/modular-nixos/; revision=15612 --- upstart-jobs/postgresql.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/upstart-jobs/postgresql.nix b/upstart-jobs/postgresql.nix index 77cf1a582e9..9bbd8d86969 100644 --- a/upstart-jobs/postgresql.nix +++ b/upstart-jobs/postgresql.nix @@ -61,6 +61,12 @@ let How to authorize users. Note: ident needs absolute trust to all allowed client hosts."; }; + enableTCPIP = mkOption { + default = false; + description = " + Whether to run PostgreSQL with -i flag to enable TCP/IP connections. + "; + }; }; }; }; @@ -79,6 +85,8 @@ let run = "${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh postgres"; + flags = if cfg.enableTCPIP then ["-i"] else []; + in mkIf config.services.postgresql.enable { @@ -120,7 +128,7 @@ mkIf config.services.postgresql.enable { cp -f ${pkgs.writeText "pg_hba.conf" cfg.authentication} ${cfg.dataDir}/pg_hba.conf end script - respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir}' + respawn ${run} -c '${postgresql}/bin/postgres -D ${cfg.dataDir} ${toString flags}' ''; }]; };