postgresql/module.nix: add postgres user with permissions
This commit is contained in:
parent
ed7e7c36f4
commit
6cb1e31986
1 changed files with 12 additions and 2 deletions
|
@ -6,7 +6,7 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
cfg = config.modules.sytem.services.database.postgresql;
|
||||
cfg = config.modules.system.services.database.postgresql;
|
||||
in {
|
||||
options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql";
|
||||
|
||||
|
@ -28,6 +28,16 @@ in {
|
|||
];
|
||||
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "postgres";
|
||||
ensureClauses = {
|
||||
superuser = true;
|
||||
login = true;
|
||||
createrole = true;
|
||||
createdb = true;
|
||||
replication = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "git";
|
||||
ensureDBOwnership = true;
|
||||
|
@ -35,7 +45,7 @@ in {
|
|||
];
|
||||
settings = {
|
||||
# taken from https://pgconfigurator.cybertec.at/
|
||||
|
||||
|
||||
# Connectivity
|
||||
max_connections = 100;
|
||||
superuser_reserved_connections = 3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue