diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-11-16 07:42:49 -0800 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-11-16 07:42:49 -0800 |
| commit | db9c490cbcf6ed593b6e10ef822c5ad7edbf13f5 (patch) | |
| tree | 424a1a95a66bf6358609c67193b65ff8c0570382 /profiles/restic-backup.nix | |
| parent | run my website from rivendell (diff) | |
| download | infra-db9c490cbcf6ed593b6e10ef822c5ad7edbf13f5.tar.gz | |
store the backup locally
We will rsync the backup later to the NAS, instead of mounting. This is simpler.
Diffstat (limited to '')
| -rw-r--r-- | profiles/restic-backup.nix | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/profiles/restic-backup.nix b/profiles/restic-backup.nix index be65da6..876641e 100644 --- a/profiles/restic-backup.nix +++ b/profiles/restic-backup.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: let restic-local = pkgs.writeShellScriptBin "restic-local" '' - export RESTIC_REPOSITORY="/data/backups/${config.networking.hostName}" + export RESTIC_REPOSITORY="/data/backups/" export RESTIC_PASSWORD_FILE="${config.age.secrets.restic-local-pw.path}" exec ${pkgs.restic}/bin/restic "$@" ''; @@ -12,50 +12,20 @@ in restic-local-pw = { file = ../secrets/restic-pw.age; }; - nas-client = { - file = ../secrets/nas_client.age; - }; }; }; - boot.kernelModules = [ - "cifs" - "cmac" - "sha256" - ]; - environment.systemPackages = [ - pkgs.cifs-utils pkgs.restic restic-local ]; - systemd.mounts = [ - { - description = "Mount for NAS volume"; - what = "//192.168.1.68/backups"; - where = "/data/backups/"; - unitConfig = { - Type = "cifs"; - }; - type = "cifs"; - options = "credentials=${config.age.secrets.nas-client.path},uid=1000,gid=1000,rw"; - } - ]; - systemd.automounts = [ - { - description = "Automount for NAS volume backups"; - where = "/data/backups"; - wantedBy = [ "multi-user.target" ]; - } - ]; - services.restic = { backups = { local = { paths = [ ]; passwordFile = config.age.secrets.restic-local-pw.path; - repository = "/data/backups/${config.networking.hostName}"; + repository = "/data/backups/"; initialize = true; timerConfig.OnCalendar = "*-*-* *:00:00"; timerConfig.RandomizedDelaySec = "5m"; |
