Merge pull request #41971 from aneeshusa/use-listen_addresses-for-postgresql

nixos/postgresql: Use listen_addresses, not -i
This commit is contained in:
Matthew Justin Bauer 2018-06-15 22:41:15 -04:00 committed by GitHub
commit 98cd8568e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,14 +24,13 @@ let
postgresql = postgresqlAndPlugins cfg.package; postgresql = postgresqlAndPlugins cfg.package;
flags = optional cfg.enableTCPIP "-i";
# The main PostgreSQL configuration file. # The main PostgreSQL configuration file.
configFile = pkgs.writeText "postgresql.conf" configFile = pkgs.writeText "postgresql.conf"
'' ''
hba_file = '${pkgs.writeText "pg_hba.conf" cfg.authentication}' hba_file = '${pkgs.writeText "pg_hba.conf" cfg.authentication}'
ident_file = '${pkgs.writeText "pg_ident.conf" cfg.identMap}' ident_file = '${pkgs.writeText "pg_ident.conf" cfg.identMap}'
log_destination = 'stderr' log_destination = 'stderr'
listen_addresses = '${if cfg.enableTCPIP then "*" else "localhost"}'
port = ${toString cfg.port} port = ${toString cfg.port}
${cfg.extraConfig} ${cfg.extraConfig}
''; '';
@ -229,7 +228,7 @@ in
"${cfg.dataDir}/recovery.conf" "${cfg.dataDir}/recovery.conf"
''} ''}
exec postgres ${toString flags} exec postgres
''; '';
serviceConfig = serviceConfig =