No description
  • Shell 58.7%
  • Nix 41.3%
Find a file
2026-04-28 09:52:35 +02:00
backup_script.sh feat: unlock restic repo before checking 2026-04-28 09:52:35 +02:00
flake.nix remove emailing capability 2026-02-25 00:21:43 +01:00
LICENSE Add license and readme 2026-02-24 01:57:49 +01:00
README.md change auth token to a file path to not configure token out in the open 2026-02-25 14:21:43 +01:00
restic-backup-runner.nix fix: use activation script to copy config to /etc instead of environment.etc with copy option which doesnt exist in NixOS 2026-04-13 15:06:02 +02:00

restic-backup-runner

Small Nix flake + NixOS module that runs a bash script to back up files and DB dumps with Restic. Built for a single self-hosted server.

What it does

  • Dumps SQLite and Postgres databases to a staging folder
  • Backs up those dumps plus any extra files/dirs with Restic
  • Optionally pings an endpoint when it finishes

Use (NixOS)

Import the module and set the basics:

{
  imports = [
    inputs.restic-backup-runner.nixosModules.default
  ];

  services.restic-backup-runner = {
    enable = true;
    settings = {
      resticPasswordFile = "/secrets/restic/password.txt";
      backupRepo = "/var/backup/restic";
      files = [ "/srv/data" ];
    };
  };
}

Notes:

  • The restic repo and password file must already exist on the server.
  • If you use Postgres, set postgresPasswordsFile to a JSON map of db name -> password.
  • If you use pingEndpoint, set pingAuthTokenFile to a readable file containing the bearer token.

Thats it. Keep it boring and it should just run.