System/modules/linux/services/postgresql.nix

25 lines
601 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;
settings = { };
};
})
(mkIf
(nathan.services.postgresql.enable && nathan.services.postgresql.backup) {
# Backup postgres
services.postgresqlBackup = {
enable = true;
compression = "zstd";
compressionLevel = 6;
backupAll = true;
# Every morning at 4 AM
startAt = "*-*-* 4:00:00";
};
})
];
}