Skip to content

Backups

The backup system is built on Restic, natively managed via NixOS (services.restic). This ensures that the backup configuration is 100% declarative and reproducible. For visual management and monitoring, Backrest is used as a web interface.

We follow a strategy that prioritizes the “Brain” (configurations, databases, and code) over the “Muscles” (heavy media files). This keeps cloud costs low and recovery times fast.

Data TypeStatusLocation (Path)Why?
System Config❌ NO/etc/nixosAlready managed via GitHub.
Service Databases✅ YES/var/lib/Home Assistant, Radarr, Sonarr, Jellyfin, etc.
Secrets & Keys✅ YES1PasswordFetched dynamically via 1Password CLI.
Downloaded Media❌ NO/var/lib/mediaToo large (TBs).

The following services have their entire state (databases, configurations, and internal state) backed up. Each service declares its own path in its .nix file using homelab.backupPaths.

ServiceSpecific Data Backed Up
Home AssistantSQLite DB, YAML configs, custom components, HACS state.
JellyfinUser profiles, watch history, metadata database.
Radarr/SonarrMedia databases (SQLite), quality profiles, indexer settings.
Prowlarr/JackettTracker configurations and API keys.
TransmissionTorrent resume data, partial downloads state, settings.
BackrestIts own internal configuration and history.

We use Backblaze B2 as our primary offsite storage. It is configured to run every night at 03:00 AM.

  • Bucket Name: javiersc-backup
  • Repository URI: b2:javiersc-backup:restic
  • Secrets (1Password):
    • Item: Backblaze - javiersc - Applycation key
    • Fields: keyID, credential, restic password

Backrest provides a Web UI to interact with Restic. In this infrastructure, Backrest is fully declarative. The repository connection and authentication are automatically configured on boot using the secrets fetched from 1Password.

While NixOS manages the background timers, Backrest is used for:

  • Monitoring the health of daily backups.
  • Exploring snapshots and performing granular restores.
  • Manual triggers for ad-hoc backups.

Unlike standard installations, you do NOT need to manually add the repository or environment variables. The service is hardened and pre-configured to point to your Backblaze B2 bucket immediately after deployment.

We keep a balanced history using Restic’s pruning capabilities:

PolicySnapshots Kept
Daily7
Weekly4
Monthly6

For a step-by-step guide on how to use these backups to recover your system, see the Full Restore Guide.