summaryrefslogtreecommitdiff
path: root/tw/system/vin.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tw/system/vin.scm')
-rw-r--r--tw/system/vin.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/tw/system/vin.scm b/tw/system/vin.scm
index d05a493b..24dd367a 100644
--- a/tw/system/vin.scm
+++ b/tw/system/vin.scm
@@ -140,10 +140,30 @@
;; For running the Grafana docker container.
(service grafana-service-type
(grafana-configuration
+ (data-path "/var/lib/grafana")
(bind-address (server-wireguard-address host-name))))
(service docker-service-type) ; required by `grafana-service-type'
(service dbus-root-service-type) ; required by `docker-service-type'
(service elogind-service-type) ; required by `docker-service-type'
+ (simple-service 'grafana-restic-backup restic-backup-service-type
+ (list (restic-scheduled-backup
+ (schedule #~"0 3 * * *")
+ (paths (list "/var/lib/grafana"))
+ (repo (restic-local-repository
+ (path "/var/backups/grafana")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/vin-grafana"))))))
+ (simple-service 'grafana-restic-cleanup restic-cleanup-service-type
+ (list (restic-scheduled-cleanup
+ (schedule #~"0 4 * * *")
+ (repo (restic-local-repository
+ (path "/var/backups/grafana")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/vin-grafana")))
+ (keep-daily 30)
+ (keep-monthly -1))))
;; Personal statistics exporter: stores hledger data (and soon location
;; data?) in Postgres for Grafana to read.