postgresql-backup: move to own services
This way the `startAt` setting is only set once.
This commit is contained in:
parent
297eb0a6f9
commit
253530ea6f
5 changed files with 28 additions and 5 deletions
19
services/postgresql-backup.nix
Normal file
19
services/postgresql-backup.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue