anchor.diff:                  chown -R postgres ${cfg.dataDir}
                   su -s ${pkgs.stdenv.shell} postgres -c 'initdb -U root'
                   rm -f ${cfg.dataDir}/*.conf
  +                touch "${cfg.dataDir}/.first_startup"
               fi
   
               ln -sfn ${configFile} ${cfg.dataDir}/postgresql.conf
  
positive.code:                 if ! kill -0 "$MAINPID"; then exit 1; fi
                  sleep 0.1
              done
            '';
  
          unitConfig.RequiresMountsFor = "${cfg.dataDir}";
  
negative.code:         '';
        };
  
        initialScript = mkOption {
          default = null;
          type = types.nullOr types.path;
          description = ''
            A file containing SQL statements to execute on first startup.
          '';
        };
  
        authMethod = mkOption {
          default = " ident sameuser ";
          description = ''
  