-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.nix
More file actions
44 lines (43 loc) · 999 Bytes
/
db.nix
File metadata and controls
44 lines (43 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{pkgs, ...}: {
services.postgresql = {
enable = true;
package = pkgs.postgresql_16;
enableTCPIP = true;
authentication = pkgs.lib.mkOverride 10 ''
local all all trust
host all all 127.0.0.1/32 trust
host all all 100.64.0.0/10 trust
'';
settings = {
port = 5432;
max_connections = 150;
};
ensureDatabases = ["atticd" "grafana" "open-webui" "pocketid"];
ensureUsers = [
{
name = "mu";
ensureClauses.superuser = true;
}
{
name = "atticd";
ensureDBOwnership = true;
}
{
name = "grafana";
ensureDBOwnership = true;
}
{
name = "open-webui";
ensureDBOwnership = true;
}
{
name = "pocketid";
ensureDBOwnership = true;
}
];
};
services.postgresqlBackup = {
enable = true;
databases = ["atticd" "grafana" "open-webui" "pocketid" "windmill"];
};
}