feat: add restic
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
9f08d58e9f
commit
fc668627ee
5 changed files with 83 additions and 2 deletions
40
hosts/common/optional/restic.nix
Normal file
40
hosts/common/optional/restic.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
sops.secrets.restic-environment = {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
sopsFile = ./secrets.yaml;
|
||||
};
|
||||
|
||||
sops.secrets.restic-password = {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
sopsFile = ./secrets.yaml;
|
||||
};
|
||||
|
||||
sops.secrets.restic-repository = {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
sopsFile = ./secrets.yaml;
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
daily = {
|
||||
initialize = true;
|
||||
|
||||
repositoryFile = config.sops.secrets.restic-repository.path;
|
||||
passwordFile = config.sops.secrets.restic-password.path;
|
||||
environmentFile = config.sops.secrets.restic-environment.path;
|
||||
|
||||
paths = [
|
||||
config.users.users.lander.home
|
||||
];
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-weekly 12"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue