nixos/secrets.nix
agent 79647356f4 Add nightly restic backups to Scaleway Object Storage
Three restic jobs share one repository:
- panel (03:30): /var/lib/containers and rootless named volumes, with the
  panel's containers stopped for a consistent copy and started again after
- system (04:00): /etc, /home, /root, /var/lib, plus consistent .dump
  copies of the Forgejo, Nextcloud, Authelia and panel SQLite databases
- maintenance (Sun 05:30): forget/prune and a 2 GB sampled check

Scaleway bills storage and egress, not requests, so objects go to One
Zone, /nix/store and images are left out, all jobs share one cache, and
pruning and checks are weekly and bounded.

Needs secrets/restic-password.age and secrets/restic-env.age to be
created before deploying; BACKUPS.md has the steps and a restore runbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gUd5tW9VHStkEKmgqu
2026-10-27 08:36:51 +00:00

28 lines
1.5 KiB
Nix

let
wsl-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhbz4AlnRrRNvUwlYd5siMTuvgvSwlJ21Tq54OA20ID reudy@DESKTOP-40EVMS3";
termux-phone = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahgKnADam4PGc9TiANkWGx09uNuS42tllj70UuyzPf u0_a279@localhost";
bash-nixos = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPAP6gemgKZVguFi6Diif+dBbMAZQupimeV9OQuUotlw vps-manual";
reudy-book = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDY+AJwXxv/kv0LvZLWPfjxbG3jsjfrtCyPzhXYGKttK reudy-book@fedora";
users = [ wsl-desktop termux-phone bash-nixos reudy-book ];
nixos-vps = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINjPVQpFlKGbDNqOVvKAFRExKHAAkKSAqKabDSMtJsth";
systems = [ nixos-vps ];
in
{
"secrets/lilsecret.age".publicKeys = users ++ systems;
# Authelia secrets - all three are required
"secrets/authelia-jwt-secret.age".publicKeys = users ++ systems;
"secrets/authelia-storage-key.age".publicKeys = users ++ systems;
"secrets/authelia-session-secret.age".publicKeys = users ++ systems;
# The hashed users database (contains bcrypt-hashed passwords)
"secrets/authelia-users.age".publicKeys = users ++ systems;
# Nextcloud admin password (plaintext, read by the nextcloud service)
"secrets/nextcloud-admin-pass.age".publicKeys = users ++ systems;
# Restic backups (backups.nix): the repository password, and an env file with
# the repository URL and Scaleway S3 keys. See BACKUPS.md.
"secrets/restic-password.age".publicKeys = users ++ systems;
"secrets/restic-env.age".publicKeys = users ++ systems;
}