diff --git a/flake.nix b/flake.nix index 307af7e..ec7b238 100644 --- a/flake.nix +++ b/flake.nix @@ -229,6 +229,7 @@ ) ./hosts/monitoring01 sops-nix.nixosModules.sops + backup-helper.nixosModules.backup-helper ]; }; jelly01 = nixpkgs.lib.nixosSystem { diff --git a/hosts/monitoring01/configuration.nix b/hosts/monitoring01/configuration.nix index 5c0a731..52be653 100644 --- a/hosts/monitoring01/configuration.nix +++ b/hosts/monitoring01/configuration.nix @@ -51,10 +51,24 @@ vim wget git + sqlite ]; services.qemuGuest.enable = true; + sops.secrets."backup_helper_secret" = { }; + backup-helper = { + enable = true; + password-file = "/run/secrets/backup_helper_secret"; + backup-dirs = [ + "/var/lib/grafana/plugins" + ]; + backup-commands = [ + # "grafana.db:${pkgs.sqlite}/bin/sqlite /var/lib/grafana/data/grafana.db .dump" + "grafana.db:${pkgs.sqlite}/bin/sqlite3 /var/lib/grafana/data/grafana.db .dump" + ]; + }; + # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];