From 8a8488aa14608a1c35658b7243852a4bdc97ca54 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Mon, 20 Jan 2025 16:36:52 +0100 Subject: [PATCH] backups woo --- hosts/ikari/configuration.nix | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/hosts/ikari/configuration.nix b/hosts/ikari/configuration.nix index 26ca3c6..2ac0cfd 100644 --- a/hosts/ikari/configuration.nix +++ b/hosts/ikari/configuration.nix @@ -5,10 +5,36 @@ { config, lib, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + + services.restic.backups."main" = { + repositoryFile = "/root/restic-main-repo"; + passwordFile = "/root/restic-main-password"; + pruneOpts = [ + "--keep-daily 7" + "--keep-weekly 5" + "--keep-monthly 12" + "--keep-yearly 2" ]; + paths = [ + "/var/lib" + "/home/daniel" + ]; + exclude = [ + "/home/*/.cache" + + "/home/*/.local/Trash" + + "/home/*/.local/share/Steam/*" + "!/home/*/.local/share/Steam/steamapps/compatdata" + + "/home/*/.cargo" + ]; + }; + services.postgresql.enable = true; services.postgresql.package = pkgs.postgresql_15;