This commit is contained in:
Lukas Wurzinger 2024-08-18 15:22:25 +02:00
parent 6375d98a74
commit 9e2bf10b0b
3 changed files with 9 additions and 8 deletions

View file

@ -5,7 +5,6 @@
pkgs,
...
}: let
backupPath = "/srv/backup";
backups = {
storage = "/srv/storage";
safe = "/srv/safe";
@ -34,18 +33,12 @@ in {
Group = "root";
};
script = ''
${lib.getExe pkgs.rsync} --verbose --verbose --archive --update --delete --mkpath ${backups.${backupName}} ${backupPath}/${backupName}/
${lib.getExe pkgs.rsync} --verbose --verbose --archive --update --delete --mkpath ${backups.${backupName}} /srv/backup/${backupName}/
'';
};
}
) (lib.attrNames backups));
fileSystems.${backupPath} = {
label = "backup";
fsType = "ext4";
options = ["noatime"];
};
age.secrets."restic-${attrName}".file = ../../secrets/restic-${attrName}.age;
services.restic.backups.${attrName} = {

View file

@ -12,6 +12,7 @@
./backup.nix
./blocky.nix
./fs.nix
./storage.nix
./syncthing.nix
];

7
hosts/vessel/fs.nix Normal file
View file

@ -0,0 +1,7 @@
{
fileSystems."/srv/backup" = {
label = "backup";
fsType = "ext4";
options = ["noatime"];
};
}