Finish Restic integration.
This commit is contained in:
parent
e6abae878e
commit
904e9fe75d
5 changed files with 68 additions and 0 deletions
34
roles/restic.nix
Normal file
34
roles/restic.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.restic.backups.home = {
|
||||
paths = [ "/home/.zfs/snapshot/restic" ];
|
||||
repository = "s3:s3.us-west-001.backblazeb2.com/nolans-nixos-backups/${config.networking.hostName}";
|
||||
environmentFile = config.age.secrets."restic_b2_${config.networking.hostName}".path;
|
||||
passwordFile = config.age.secrets."restic_password_${config.networking.hostName}".path;
|
||||
initialize = true;
|
||||
backupPrepareCommand = "${pkgs.zfs}/bin/zfs snapshot zpool/home@restic";
|
||||
backupCleanupCommand = "${pkgs.zfs}/bin/zfs destroy zpool/home@restic";
|
||||
timerConfig = {
|
||||
OnCalendar = "hourly";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
services.restic.backups.var = {
|
||||
paths = [ "/var/.zfs/snapshot/restic" ];
|
||||
repository = "s3:s3.us-west-001.backblazeb2.com/nolans-nixos-backups/${config.networking.hostName}";
|
||||
environmentFile = config.age.secrets."restic_b2_${config.networking.hostName}".path;
|
||||
passwordFile = config.age.secrets."restic_password_${config.networking.hostName}".path;
|
||||
initialize = true;
|
||||
backupPrepareCommand = "${pkgs.zfs}/bin/zfs snapshot zpool/var@restic";
|
||||
backupCleanupCommand = "${pkgs.zfs}/bin/zfs destroy zpool/var@restic";
|
||||
timerConfig = {
|
||||
OnCalendar = "hourly";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
age.secrets."restic_b2_${config.networking.hostName}".file =
|
||||
../secrets/restic_b2_${config.networking.hostName}.age;
|
||||
age.secrets."restic_password_${config.networking.hostName}".file =
|
||||
../secrets/restic_password_${config.networking.hostName}.age;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue