From c65077a15b57ee23d00853cfdc59f113e4c74665 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 28 Aug 2024 15:20:34 +0200 Subject: [PATCH] hiroshi: Add postgresql --- machines/hiroshi/configuration.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/machines/hiroshi/configuration.nix b/machines/hiroshi/configuration.nix index 7eddba1..20fbf75 100644 --- a/machines/hiroshi/configuration.nix +++ b/machines/hiroshi/configuration.nix @@ -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" ]; + }; }