Add backups
This commit is contained in:
parent
e3004d18d8
commit
df300154b3
24
backups.nix
Normal file
24
backups.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
./nextcloud.nix
|
||||
./authentik.nix
|
||||
./forgejo.nix
|
||||
./backups.nix
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue