about summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorMatthew Justin Bauer <mjbauer95@gmail.com>2018-06-15 22:41:15 -0400
committerGitHub <noreply@github.com>2018-06-15 22:41:15 -0400
commit98cd8568e5c449a30eb022a15546b63c466ef806 (patch)
treef98a75e2e3433717f60533649033207cfe818c04 /nixos/modules/services
parent53a75e3a2af7fc3788287e13bcc86f43fff48d3f (diff)
parent94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a (diff)
downloadnixlib-98cd8568e5c449a30eb022a15546b63c466ef806.tar
nixlib-98cd8568e5c449a30eb022a15546b63c466ef806.tar.gz
nixlib-98cd8568e5c449a30eb022a15546b63c466ef806.tar.bz2
nixlib-98cd8568e5c449a30eb022a15546b63c466ef806.tar.lz
nixlib-98cd8568e5c449a30eb022a15546b63c466ef806.tar.xz
nixlib-98cd8568e5c449a30eb022a15546b63c466ef806.tar.zst
nixlib-98cd8568e5c449a30eb022a15546b63c466ef806.zip
Merge pull request #41971 from aneeshusa/use-listen_addresses-for-postgresql
nixos/postgresql: Use listen_addresses, not -i
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/databases/postgresql.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix
index 4ad4728ccda6..42d61fa1b368 100644
--- a/nixos/modules/services/databases/postgresql.nix
+++ b/nixos/modules/services/databases/postgresql.nix
@@ -24,14 +24,13 @@ let
 
   postgresql = postgresqlAndPlugins cfg.package;
 
-  flags = optional cfg.enableTCPIP "-i";
-
   # The main PostgreSQL configuration file.
   configFile = pkgs.writeText "postgresql.conf"
     ''
       hba_file = '${pkgs.writeText "pg_hba.conf" cfg.authentication}'
       ident_file = '${pkgs.writeText "pg_ident.conf" cfg.identMap}'
       log_destination = 'stderr'
+      listen_addresses = '${if cfg.enableTCPIP then "*" else "localhost"}'
       port = ${toString cfg.port}
       ${cfg.extraConfig}
     '';
@@ -229,7 +228,7 @@ in
                 "${cfg.dataDir}/recovery.conf"
             ''}
 
-             exec postgres ${toString flags}
+             exec postgres
           '';
 
         serviceConfig =