restic env vars
This commit is contained in:
@@ -21,17 +21,29 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = let
|
||||||
|
resticRepository = "rest:https://soteria.john-stream.com/${cfg.repoName}";
|
||||||
|
caCert = "${config.mtls.certDir}/root_ca.crt";
|
||||||
|
mtlsClientCert = "${config.mtls.certDir}/${config.mtls.bundleFilename}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.sessionVariables = {
|
||||||
|
RESTIC_REPOSITORY = resticRepository;
|
||||||
|
RESTIC_PASSWORD_FILE = cfg.passwordFile;
|
||||||
|
RESTIC_CACERT = caCert;
|
||||||
|
RESTIC_TLS_CLIENT_CERT = mtlsClientCert;
|
||||||
|
};
|
||||||
|
|
||||||
services.restic = {
|
services.restic = {
|
||||||
enable = true;
|
enable = true;
|
||||||
backups.${cfg.repoName} = {
|
backups.${cfg.repoName} = {
|
||||||
|
repository = resticRepository;
|
||||||
passwordFile = cfg.passwordFile;
|
passwordFile = cfg.passwordFile;
|
||||||
paths = cfg.paths;
|
|
||||||
repository = "rest:https://soteria.john-stream.com/${cfg.repoName}";
|
|
||||||
extraBackupArgs = [
|
extraBackupArgs = [
|
||||||
"--tls-client-cert ${config.mtls.certDir}/${config.mtls.bundleFilename}"
|
"--tls-client-cert ${mtlsClientCert}"
|
||||||
"--cacert ${config.mtls.certDir}/root_ca.crt"
|
"--cacert ${caCert}"
|
||||||
];
|
];
|
||||||
|
paths = cfg.paths;
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "00:05";
|
OnCalendar = "00:05";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user