summaryrefslogtreecommitdiff
path: root/hosts/vidhar/postgresql.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-01-03 17:29:55 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2025-01-03 17:29:55 +0100
commitd650b72c0f71142426106db4dd71b2e7c7c413a5 (patch)
treeffb06a5ace40aa902dfc9e2834c423bfb4447fee /hosts/vidhar/postgresql.nix
parent27a172993d78bf736ab1e5a14a7a5525f4866235 (diff)
downloadnixos-d650b72c0f71142426106db4dd71b2e7c7c413a5.tar
nixos-d650b72c0f71142426106db4dd71b2e7c7c413a5.tar.gz
nixos-d650b72c0f71142426106db4dd71b2e7c7c413a5.tar.bz2
nixos-d650b72c0f71142426106db4dd71b2e7c7c413a5.tar.xz
nixos-d650b72c0f71142426106db4dd71b2e7c7c413a5.zip
immich
Diffstat (limited to 'hosts/vidhar/postgresql.nix')
-rw-r--r--hosts/vidhar/postgresql.nix32
1 files changed, 32 insertions, 0 deletions
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 @@
1{ pkgs, config, flake, flakeInputs, ... }:
2
3let
4 nixpkgs-pgbackrest = import (flakeInputs.nixpkgs-pgbackrest.outPath + "/pkgs/top-level") {
5 overlays = [ flake.overlays.libdscp ];
6 localSystem = config.nixpkgs.system;
7 };
8in {
9 config = {
10 services.postgresql = {
11 enable = true;
12 package = pkgs.postgresql_15;
13 };
14
15 services.pgbackrest = {
16 settings."vidhar" = {
17 pg1-path = config.services.postgresql.dataDir;
18
19 repo1-path = "/var/lib/pgbackrest";
20 repo1-retention-full-type = "time";
21 repo1-retention-full = 14;
22 repo1-retention-archive = 7;
23 };
24
25 backups."vidhar-daily" = {
26 stanza = "vidhar";
27 repo = "1";
28 timerConfig.OnCalendar = "daily";
29 };
30 };
31 };
32}