From d650b72c0f71142426106db4dd71b2e7c7c413a5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 3 Jan 2025 17:29:55 +0100 Subject: immich --- hosts/vidhar/postgresql.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 hosts/vidhar/postgresql.nix (limited to 'hosts/vidhar/postgresql.nix') diff --git a/hosts/vidhar/postgresql.nix b/hosts/vidhar/postgresql.nix new file mode 100644 index 00000000..fa5b734f --- /dev/null +++ b/hosts/vidhar/postgresql.nix @@ -0,0 +1,32 @@ +{ pkgs, config, flake, flakeInputs, ... }: + +let + nixpkgs-pgbackrest = import (flakeInputs.nixpkgs-pgbackrest.outPath + "/pkgs/top-level") { + overlays = [ flake.overlays.libdscp ]; + localSystem = config.nixpkgs.system; + }; +in { + config = { + services.postgresql = { + enable = true; + package = pkgs.postgresql_15; + }; + + services.pgbackrest = { + settings."vidhar" = { + pg1-path = config.services.postgresql.dataDir; + + repo1-path = "/var/lib/pgbackrest"; + repo1-retention-full-type = "time"; + repo1-retention-full = 14; + repo1-retention-archive = 7; + }; + + backups."vidhar-daily" = { + stanza = "vidhar"; + repo = "1"; + timerConfig.OnCalendar = "daily"; + }; + }; + }; +} -- cgit v1.2.3