System/modules/linux/services/postgresql.nix

21 lines
531 B
Nix
Raw Normal View History

2023-05-07 00:50:39 -04:00
{ config, lib, pkgs, ... }:
let nathan = config.nathan;
in with lib; {
config = mkMerge [
(mkIf nathan.services.postgresql.enable {
services.postgresql = { enable = true; };
})
(mkIf
(nathan.services.postgresql.enable && nathan.services.postgresql.backup) {
# Backup postgres
services.postgresqlBackup = {
enable = true;
2023-06-04 12:33:47 -04:00
compression = "none";
2023-05-07 00:50:39 -04:00
backupAll = true;
# Every morning at 4 AM
startAt = "*-*-* 4:00:00";
};
})
];
}