From acbd86f5894225e537ec4f5b0a066ba01a9e38b3 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 16 Mar 2026 08:02:28 -0500 Subject: [PATCH] added restic user options --- modules/services/restic/restic.nix | 88 +++++++++++++++--------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/modules/services/restic/restic.nix b/modules/services/restic/restic.nix index b0c753d..8f5c9f4 100644 --- a/modules/services/restic/restic.nix +++ b/modules/services/restic/restic.nix @@ -1,46 +1,4 @@ -{ ... }: -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 { +{ inputs, ... }: { flake.modules.homeManager.restic = { config, pkgs, lib, ... }: let cfg = config.restic; @@ -66,9 +24,51 @@ in { config = { services.restic = { enable = true; - backups.${cfg.repoName} = (resticFactory cfg.repoName) // { + backups.${cfg.repoName} = { 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" + ]; + 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" + ]; }; }; };