System/modules/linux/services/postgresql.nix

21 lines
531 B
Nix

{ 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;
compression = "none";
backupAll = true;
# Every morning at 4 AM
startAt = "*-*-* 4:00:00";
};
})
];
}