postgresql-backup: move to own services

This way the `startAt` setting is only set once.
This commit is contained in:
Antoine Martin 2021-01-30 22:15:33 +01:00
parent 297eb0a6f9
commit 253530ea6f
5 changed files with 28 additions and 5 deletions

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.my.services.postgresql-backup;
in {
options.my.services.postgresql-backup = {
enable = mkEnableOption "Backup SQL databases";
};
config = mkIf cfg.enable {
services.postgresqlBackup = {
enable = true;
# Borg backup starts at midnight so create DB dump just before
startAt = "*-*-* 23:30:00";
};
};
}