summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/surtr/postgresql/default.nix4
-rw-r--r--hosts/vidhar/pgbackrest/default.nix14
2 files changed, 15 insertions, 3 deletions
diff --git a/hosts/surtr/postgresql/default.nix b/hosts/surtr/postgresql/default.nix
index 54693b50..8c373f49 100644
--- a/hosts/surtr/postgresql/default.nix
+++ b/hosts/surtr/postgresql/default.nix
@@ -1,4 +1,4 @@
1{ pkgs, sources, config, flake, ... }: 1{ pkgs, sources, config, flake, flakeInputs, ... }:
2let 2let
3 versioning = sources.psql-versioning.src; 3 versioning = sources.psql-versioning.src;
4in { 4in {
@@ -10,6 +10,8 @@ in {
10 10
11 services.pgbackrest = { 11 services.pgbackrest = {
12 enable = true; 12 enable = true;
13 package = flakeInputs.nixpkgs-stable.legacyPackages.${config.nixpkgs.system}.pgbackrest;
14
13 settings = { 15 settings = {
14 "surtr" = { 16 "surtr" = {
15 pg1-path = config.services.postgresql.dataDir; 17 pg1-path = config.services.postgresql.dataDir;
diff --git a/hosts/vidhar/pgbackrest/default.nix b/hosts/vidhar/pgbackrest/default.nix
index e3fdc2b5..c3ba603a 100644
--- a/hosts/vidhar/pgbackrest/default.nix
+++ b/hosts/vidhar/pgbackrest/default.nix
@@ -1,4 +1,4 @@
1{ config, flake, ... }: 1{ config, flake, flakeInputs, ... }:
2 2
3let 3let
4 surtrRepoCfg = flake.nixosConfigurations."surtr".config.services.pgbackrest.settings.surtr; 4 surtrRepoCfg = flake.nixosConfigurations."surtr".config.services.pgbackrest.settings.surtr;
@@ -6,6 +6,8 @@ in {
6 config = { 6 config = {
7 services.pgbackrest = { 7 services.pgbackrest = {
8 enable = true; 8 enable = true;
9 package = flakeInputs.nixpkgs-stable.legacyPackages.${config.nixpkgs.system}.pgbackrest;
10
9 tlsServer = { 11 tlsServer = {
10 enable = true; 12 enable = true;
11 13
@@ -39,7 +41,7 @@ in {
39 41
40 "srv01.uniworx.de" = { 42 "srv01.uniworx.de" = {
41 pg1-host-type = "tls"; 43 pg1-host-type = "tls";
42 pg1-host = "srv01.uniworx.de"; 44 pg1-host = "2a03:4000:5e:e55::";
43 pg1-host-ca-file = toString ./ca/ca.crt; 45 pg1-host-ca-file = toString ./ca/ca.crt;
44 pg1-host-cert-file = toString ./ca/vidhar.crt; 46 pg1-host-cert-file = toString ./ca/vidhar.crt;
45 pg1-host-key-file = config.sops.secrets."pgbackrest.key".path; 47 pg1-host-key-file = config.sops.secrets."pgbackrest.key".path;
@@ -82,6 +84,14 @@ in {
82 group = "pgbackrest"; 84 group = "pgbackrest";
83 timerConfig.OnCalendar = "daily Europe/Berlin"; 85 timerConfig.OnCalendar = "daily Europe/Berlin";
84 }; 86 };
87
88 backups."srv01.uniworx.de-daily" = {
89 stanza = "srv01.uniworx.de";
90 repo = "2";
91 user = "pgbackrest";
92 group = "pgbackrest";
93 timerConfig.OnCalendar = "daily Europe/Berlin";
94 };
85 }; 95 };
86 96
87 systemd.tmpfiles.rules = [ 97 systemd.tmpfiles.rules = [