mirror of
https://github.com/Death916/nixconfig.git
synced 2026-04-10 02:54:39 -07:00
restic
This commit is contained in:
parent
347c6cd8db
commit
37540f55aa
2 changed files with 73 additions and 0 deletions
37
modules/nixos/homelab/restic.nix
Normal file
37
modules/nixos/homelab/restic.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
services.restic.backups.homelab = {
|
||||
user = "root";
|
||||
initialize = true;
|
||||
passwordFile = "/etc/nixos/secrets/restic-auth";
|
||||
repository = "s3:d8j2.or.idrivee2-38.com/backups";
|
||||
environmentFile = "/etc/nixos/secrets/restic.env";
|
||||
paths = [
|
||||
"/home/"
|
||||
"/root"
|
||||
"/var/lib/"
|
||||
"/var/log/"
|
||||
"/etc/"
|
||||
"/storage/"
|
||||
|
||||
];
|
||||
pruneOpts = [
|
||||
"--keep-hourly 48"
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 5"
|
||||
];
|
||||
extraBackupArgs = [
|
||||
"--verbose"
|
||||
"--exclude-caches"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
36
modules/nixos/orac/restic.nix
Normal file
36
modules/nixos/orac/restic.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
services.restic.backups.orac = {
|
||||
user = "root";
|
||||
initialize = true;
|
||||
passwordFile = "/etc/nixos/secrets/restic-auth";
|
||||
repository = "s3:d8j2.or.idrivee2-38.com/backups";
|
||||
environmentFile = "/etc/nixos/secrets/restic.env";
|
||||
paths = [
|
||||
"/home/"
|
||||
"/root"
|
||||
"/var/lib/"
|
||||
"/var/log/"
|
||||
"/etc/"
|
||||
|
||||
];
|
||||
pruneOpts = [
|
||||
"--keep-hourly 48"
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 4"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 5"
|
||||
];
|
||||
extraBackupArgs = [
|
||||
"--verbose"
|
||||
"--exclude-caches"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue