MyNixOS website logo
option

services.postgresql.ensureUsers

Ensures that the specified users exist. The PostgreSQL users will be identified using peer authentication. This authenticates the Unix user with the same name only, and that without the need for a password. This option will never delete existing users or remove DB ownership of databases once granted with ensureDBOwnership = true;. This means that this must be cleaned up manually when changing after changing the config in here.

Declarations
Type
list of (submodule)
Default
[ ]
Example
[
  {
    name = "nextcloud";
  }
  {
    name = "superuser";
    ensureDBOwnership = true;
  }
]