diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index a83b1a110fed..cc4230d4d6a7 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -190,7 +190,7 @@ in mkdir -m 0700 -p ${cfg.dataDir} if [ "$(id -u)" = 0 ]; then chown -R postgres ${cfg.dataDir} - su -s ${pkgs.stdenv.shell} postgres -c initdb + su -s ${pkgs.stdenv.shell} postgres -c 'initdb -U root' else # For non-root operation. initdb