krops-multi-deploy/config/machines/example-machine/borg-lnbits.nix
padreug 17ac393c32 Adds LNbits Borg backup module
Implements a new module for backing up LNbits data using Borg.

This module automates hourly backups, encrypts the data, and provides point-in-time recovery. It includes scripts for listing, restoring, and mounting backups. A comprehensive setup guide is provided in the documentation.

The configuration allows specifying the Borg repository location, schedule, compression settings, retention policy, and SSH key for secure access.
2025-11-01 11:25:36 +01:00

35 lines
1 KiB
Nix

{ config, pkgs, ... }:
{
imports = [
./modules/lnbits-backup.nix # Add this line
];
# Enable LNbits Borg backup
services.lnbits-backup = {
enable = true;
# Repository path - update with your actual path
# Option 1: Traditional format
# repository = "borg@192.168.1.100:/mnt/my_ssd/borg-backups/lnbits";
# Option 2: Full SSH URL format (note double slash for absolute path)
repository = "ssh://borg@<your-backup-ip>//mnt/borg-backups/lnbits";
# Backup schedule
schedule = "*:0/15"; # Backup schedule (hourly, daily, or systemd timer format)
# Compression with auto-detection
# "auto" skips compression for already-compressed files (images, videos, etc.)
compression = "auto,lz4"; # For Raspberry Pi (faster)
# compression = "auto,zstd"; # For RockPro64 (better compression)
# Retention policy, leave all of these
retention = {
hourly = 24; # Last 24 hours
daily = 7; # Last 7 days
weekly = 4; # Last 4 weeks
monthly = 6; # Last 6 months
};
};
}