2023-05-03 17:49:50 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
/* enableTCPIP = true; # Expose on the network */
|
|
|
|
authentication = pkgs.lib.mkOverride 10 ''
|
2023-05-11 14:34:13 +02:00
|
|
|
local gitea all ident map=gitea-users
|
2023-06-07 20:23:49 +02:00
|
|
|
local vaultwarden all ident map=vaultwarden-users
|
2023-05-03 17:49:50 +02:00
|
|
|
local all all trust
|
|
|
|
host all all 127.0.0.1/32 trust
|
|
|
|
host all all ::1/128 trust
|
|
|
|
'';
|
2023-05-11 14:34:13 +02:00
|
|
|
identMap = ''
|
|
|
|
gitea-users gitea gitea
|
2023-06-07 20:23:49 +02:00
|
|
|
vaultwarden-users vaultwarden vaultwarden
|
2023-05-11 14:34:13 +02:00
|
|
|
'';
|
2023-05-03 17:49:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
services.postgresqlBackup = {
|
|
|
|
enable = true;
|
|
|
|
location = "/var/backup/postgres";
|
|
|
|
startAt = "*-*-* 03:15:00";
|
|
|
|
backupAll = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = [ config.services.postgresql.package ];
|
|
|
|
}
|
|
|
|
|
|
|
|
|