nixos-config/services/postgresql-backup.nix
Antoine Martin 253530ea6f postgresql-backup: move to own services
This way the `startAt` setting is only set once.
2021-01-30 22:32:12 +01:00

20 lines
398 B
Nix

{ 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";
};
};
}