Add backups

This commit is contained in:
mewp 2025-01-22 22:21:37 +00:00
parent e3004d18d8
commit df300154b3
2 changed files with 25 additions and 0 deletions

24
backups.nix Normal file
View file

@ -0,0 +1,24 @@
{ lib, ... }: {
system.activationScripts.makeBackupDir = lib.stringAfter [ "var" ] ''
mkdir -p /var/lib/backup
'';
services.forgejo.dump = {
enable = true;
file = "forgejo-dump";
backupDir = "/var/lib/backup";
};
services.restic.backups.s3 = {
passwordFile = "/var/secrets/restic-backup";
environmentFile = "/var/secrets/restic-s3";
initialize = true;
repository = "s3:https://object.ceph-waw3.hswaw.net/cebulacamp-backups";
paths = [
"/var/lib/backup"
"/var/lib/postgresql"
"/var/lib/redis-authentik"
"/var/lib/nextcloud"
];
};
}

View file

@ -13,6 +13,7 @@
./nextcloud.nix ./nextcloud.nix
./authentik.nix ./authentik.nix
./forgejo.nix ./forgejo.nix
./backups.nix
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;