* Synced with trunk @ 15391

svn path=/nixos/branches/modular-nixos/; revision=15612
This commit is contained in:
Marc Weber 2009-05-15 08:00:20 +00:00
parent 48e4b8f573
commit d44206d2c4

@ -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}'
'';
}];
};