feat: refactor the modules/servers directory.
This commit is contained in:
parent
4e783c052b
commit
8b754d3a7e
69 changed files with 61 additions and 62 deletions
40
modules/servers/common/restic.nix
Normal file
40
modules/servers/common/restic.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{config, ...}: let
|
||||
opts = {
|
||||
paths = [
|
||||
"/var/lib/private"
|
||||
];
|
||||
pruneOpts = [
|
||||
"--keep-last 10"
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
];
|
||||
pruneOptsLocal = [
|
||||
"--keep-last 2"
|
||||
];
|
||||
checkOpts = [
|
||||
"--read-data-subset=10%"
|
||||
"--with-cache"
|
||||
];
|
||||
};
|
||||
in {
|
||||
services.restic.backups = {
|
||||
local = {
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-server-local-pass.path;
|
||||
repository = "/var/lib/backup";
|
||||
paths = opts.paths;
|
||||
pruneOpts = opts.pruneOptsLocal;
|
||||
checkOpts = opts.checkOpts;
|
||||
};
|
||||
server = {
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-server-pass.path;
|
||||
repositoryFile = config.age.secrets.restic-server-repo.path;
|
||||
environmentFile = config.age.secrets.restic-server-env.path;
|
||||
paths = opts.paths;
|
||||
pruneOpts = opts.pruneOpts;
|
||||
checkOpts = opts.checkOpts;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue