hiroshi: Add postgresql

This commit is contained in:
Simon Bruder 2024-08-28 15:20:34 +02:00
parent aa0d1752f6
commit c65077a15b
Signed by: simon
GPG key ID: 347FF8699CDA0776

View file

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{ pkgs, ... }:
{
imports = [
./hardware-configuration.nix
@ -30,4 +32,20 @@
system.stateVersion = "24.05";
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.postgresql = {
enable = true;
package = pkgs.postgresql_16;
};
services.postgresqlBackup = {
enable = true;
startAt = [ ]; # triggered by restic system backup
location = "/var/lib/postgresql-backup";
compression = "none";
};
systemd.services.restic-backups-system = {
after = [ "postgresqlBackup.service" ];
wants = [ "postgresqlBackup.service" ];
};
}