added restic user options
This commit is contained in:
@@ -1,46 +1,4 @@
|
|||||||
{ ... }:
|
{ inputs, ... }: {
|
||||||
let
|
|
||||||
resticFactory = repoName: {
|
|
||||||
repository = "rest:https://soteria.john-stream.com/${repoName}";
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "00:05";
|
|
||||||
Persistent = true;
|
|
||||||
RandomizedDelaySec = "5h";
|
|
||||||
};
|
|
||||||
runCheck = true;
|
|
||||||
pruneOpts = [
|
|
||||||
"--keep-last 10"
|
|
||||||
"--keep-hourly 8"
|
|
||||||
"--keep-daily 14"
|
|
||||||
"--keep-weekly 8"
|
|
||||||
"--keep-monthly 12"
|
|
||||||
];
|
|
||||||
exclude = [
|
|
||||||
".cache"
|
|
||||||
".devenv"
|
|
||||||
".rustup"
|
|
||||||
".cargo"
|
|
||||||
".venv"
|
|
||||||
".pyenv"
|
|
||||||
".vscode*"
|
|
||||||
"data/postgres"
|
|
||||||
"build"
|
|
||||||
"__pycache__"
|
|
||||||
"*.log"
|
|
||||||
"*.egg-info"
|
|
||||||
"*.csv"
|
|
||||||
"*.m4a"
|
|
||||||
".local/share/Steam"
|
|
||||||
".local/share/Trash"
|
|
||||||
"dist"
|
|
||||||
"/home/*/Pictures"
|
|
||||||
"/home/*/Videos"
|
|
||||||
"/home/*/go"
|
|
||||||
"/home/*/snap"
|
|
||||||
"/home/john/john-nas"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
flake.modules.homeManager.restic = { config, pkgs, lib, ... }:
|
flake.modules.homeManager.restic = { config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.restic;
|
cfg = config.restic;
|
||||||
@@ -66,9 +24,51 @@ in {
|
|||||||
config = {
|
config = {
|
||||||
services.restic = {
|
services.restic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
backups.${cfg.repoName} = (resticFactory cfg.repoName) // {
|
backups.${cfg.repoName} = {
|
||||||
passwordFile = cfg.passwordFile;
|
passwordFile = cfg.passwordFile;
|
||||||
paths = cfg.paths;
|
paths = cfg.paths;
|
||||||
|
repository = "rest:https://soteria.john-stream.com/${cfg.repoName}";
|
||||||
|
extraBackupArgs = [
|
||||||
|
"--tls-client-cert ${config.mtls.certDir}/${config.mtls.bundleFilename}"
|
||||||
|
"--cacert ${config.mtls.certDir}/root_ca.crt"
|
||||||
|
];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "00:05";
|
||||||
|
Persistent = true;
|
||||||
|
RandomizedDelaySec = "5h";
|
||||||
|
};
|
||||||
|
runCheck = true;
|
||||||
|
pruneOpts = [
|
||||||
|
"--keep-last 10"
|
||||||
|
"--keep-hourly 8"
|
||||||
|
"--keep-daily 14"
|
||||||
|
"--keep-weekly 8"
|
||||||
|
"--keep-monthly 12"
|
||||||
|
];
|
||||||
|
exclude = [
|
||||||
|
".cache"
|
||||||
|
".devenv"
|
||||||
|
".rustup"
|
||||||
|
".cargo"
|
||||||
|
".venv"
|
||||||
|
".pyenv"
|
||||||
|
".vscode*"
|
||||||
|
"data/postgres"
|
||||||
|
"build"
|
||||||
|
"__pycache__"
|
||||||
|
"*.log"
|
||||||
|
"*.egg-info"
|
||||||
|
"*.csv"
|
||||||
|
"*.m4a"
|
||||||
|
".local/share/Steam"
|
||||||
|
".local/share/Trash"
|
||||||
|
"dist"
|
||||||
|
"/home/*/Pictures"
|
||||||
|
"/home/*/Videos"
|
||||||
|
"/home/*/go"
|
||||||
|
"/home/*/snap"
|
||||||
|
"/home/john/john-nas"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user