restic env vars

This commit is contained in:
John Lancaster
2026-03-17 11:57:40 -05:00
parent e61bec46d2
commit f8c40ff627

View File

@@ -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 = {
enable = true;
backups.${cfg.repoName} = {
repository = resticRepository;
passwordFile = cfg.passwordFile;
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"
"--tls-client-cert ${mtlsClientCert}"
"--cacert ${caCert}"
];
paths = cfg.paths;
timerConfig = {
OnCalendar = "00:05";
Persistent = true;