System/modules/linux/services/postgresql.nix

22 lines
563 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 = "zstd";
compressionLevel = 6;
backupAll = true;
# Every morning at 4 AM
startAt = "*-*-* 4:00:00";
};
})
];
}