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
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
cfg = config.modules.sytem.services.database.postgresql;
|
cfg = config.modules.system.services.database.postgresql;
|
||||||
in {
|
in {
|
||||||
options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql";
|
options.modules.system.services.database.postgresql.enable = mkEnableOption "postgresql";
|
||||||
|
|
||||||
|
@ -28,6 +28,16 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
|
{
|
||||||
|
name = "postgres";
|
||||||
|
ensureClauses = {
|
||||||
|
superuser = true;
|
||||||
|
login = true;
|
||||||
|
createrole = true;
|
||||||
|
createdb = true;
|
||||||
|
replication = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "git";
|
name = "git";
|
||||||
ensureDBOwnership = true;
|
ensureDBOwnership = true;
|
||||||
|
@ -35,7 +45,7 @@ in {
|
||||||
];
|
];
|
||||||
settings = {
|
settings = {
|
||||||
# taken from https://pgconfigurator.cybertec.at/
|
# taken from https://pgconfigurator.cybertec.at/
|
||||||
|
|
||||||
# Connectivity
|
# Connectivity
|
||||||
max_connections = 100;
|
max_connections = 100;
|
||||||
superuser_reserved_connections = 3;
|
superuser_reserved_connections = 3;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue