From 99be0277b1925e864702fa6fa0feddcf9d33726b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 12 Jul 2023 12:28:45 +0200 Subject: [PATCH] feat(restic): backup home-assistant --- systems/zaatar/configuration.nix | 2 +- systems/zaatar/home-assistant.nix | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/systems/zaatar/configuration.nix b/systems/zaatar/configuration.nix index 18d34cf..02af140 100644 --- a/systems/zaatar/configuration.nix +++ b/systems/zaatar/configuration.nix @@ -45,7 +45,7 @@ in { restic.file = ../../secrets/restic.age; }; - services.restic.backups.moodle-dl = { + services.restic.backups.niveum = { initialize = true; inherit (restic) repository; timerConfig = { diff --git a/systems/zaatar/home-assistant.nix b/systems/zaatar/home-assistant.nix index efe9202..d5eaa82 100644 --- a/systems/zaatar/home-assistant.nix +++ b/systems/zaatar/home-assistant.nix @@ -1,5 +1,6 @@ -let +{config, ...}: let port = 8123; + inherit (import ../../lib) restic; in { networking.firewall.allowedTCPPorts = [port]; @@ -9,6 +10,19 @@ in { }; }; + services.restic.backups.niveum = { + initialize = true; + inherit (restic) repository; + timerConfig = { + OnCalendar = "daily"; + RandomizedDelaySec = "1h"; + }; + passwordFile = config.age.secrets.restic.path; + paths = [ + "/var/lib/containers/storage/volumes/home-assistant.bak/_data/backups" + ]; + }; + virtualisation.oci-containers = { backend = "podman"; containers.homeassistant = {