about summary refs log tree commit diff
path: root/hosts/common/server/grafana.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-07 07:40:09 -0800
committerFranck Cuny <franck@fcuny.net>2022-03-07 07:40:09 -0800
commitae0512187119963ec7000e011871904ceb531600 (patch)
treed74cd64d1d9110d22fb89104c5a5e49d7f49849b /hosts/common/server/grafana.nix
parentprometheus: backup the data directory (diff)
downloadworld-ae0512187119963ec7000e011871904ceb531600.tar.gz
grafana: backup the data directory
Diffstat (limited to '')
-rw-r--r--hosts/common/server/grafana.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/hosts/common/server/grafana.nix b/hosts/common/server/grafana.nix
index 50e7eed..61445a8 100644
--- a/hosts/common/server/grafana.nix
+++ b/hosts/common/server/grafana.nix
@@ -23,4 +23,18 @@
       }];
     };
   };
+
+  age.secrets.restic-repo-systems.file =
+    ../../../secrets/restic/repo-systems.age;
+
+  services.restic.backups = {
+    grafana = {
+      paths = [ "/var/lib/grafana/data" ];
+      repository = "/data/slow/backups/systems";
+      passwordFile = config.age.secrets.restic-repo-systems.path;
+      initialize = true;
+      extraBackupArgs = [ "--tag grafana" ];
+      pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" ];
+    };
+  };
 }