{
  flake,
  ...
}:
let
  inherit (flake.config.services) instances;

  service = instances.postgresql;
in
{
  services = {
    postgresqlBackup = {
      enable = true;
      startAt = "*-*-* 07:00:00";
    };
    postgresql = {
      enable = true;
    };
  };

  networking = {
    firewall = {
      allowedTCPPorts = [
        service.ports.port0
      ];
    };
  };

}
