summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorAneesh Agrawal <aneeshusa@gmail.com>2017-05-12 14:54:13 -0400
committerAneesh Agrawal <aneeshusa@gmail.com>2018-06-13 23:03:02 -0700
commit94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a (patch)
tree8d35d8883db035afae159224ec3505feaf9bdfdb /nixos
parent3e3a9e661d7ef83f9dfc26d948a12f8ee1334f6d (diff)
downloadnixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.tar
nixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.tar.gz
nixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.tar.bz2
nixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.tar.lz
nixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.tar.xz
nixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.tar.zst
nixpkgs-94bd4787a93b5fbc1a8f3484b2899e2e923d2c0a.zip
nixos/postgresql: Use listen_addresses, not -i
The -i flag to control if PostgreSQL listens for TCP/IP connections has
been deprecated, so replace it with the modern alternative.
Diffstat (limited to 'nixos')
-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 4ad4728ccda..42d61fa1b36 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 =