bicep/{postgres,mysql}: split config into several files

This commit is contained in:
h7x4
2026-01-29 13:18:25 +09:00
parent 49d1122ee5
commit d6eca5c4e3
5 changed files with 59 additions and 45 deletions

View File

@@ -0,0 +1,27 @@
{ config, lib, ... }:
let
cfg = config.services.postgresql;
in
{
services.postgresqlBackup = lib.mkIf cfg.enable {
enable = true;
location = "/var/lib/postgres-backups";
backupAll = true;
};
services.rsync-pull-targets = lib.mkIf cfg.enable {
enable = true;
locations.${config.services.postgresqlBackup.location} = {
user = "root";
rrsyncArgs.ro = true;
authorizedKeysAttrs = [
"restrict"
"no-agent-forwarding"
"no-port-forwarding"
"no-pty"
"no-X11-forwarding"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGvO7QX7QmwSiGLXEsaxPIOpAqnJP3M+qqQRe5dzf8gJ postgresql rsync backup";
};
};
}