fix(viridian): resolve backup system initialization issues

Fix snapper and borgbackup jobs to work with ephemeral-btrfs setup:

Snapper fixes:
- Remove global /.snapshots mount (use nested subvolumes instead)
- Remove unused hostname variable
- Snapshots now stored in .snapshots subvolumes within each service

Borgbackup fixes:
- Add systemd.tmpfiles.rules to create staging directories at boot
- Add readWritePaths for staging directories (systemd sandboxing)
- Staging directories survive ephemeral root wipes

Architecture notes:
- Nested .snapshots subvolumes don't require separate mounts
- systemd tmpfiles ensures directories exist before services start
- ProtectSystem=strict requires explicit ReadWritePaths allowlist
This commit is contained in:
♥ Minnie ♥ 2025-10-07 09:38:07 +08:00
parent c05598d9e0
commit 7833d89d86
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
3 changed files with 18 additions and 13 deletions

View file

@ -1,17 +1,6 @@
{config, ...}: let
hostname = config.networking.hostName;
in {
# Mount snapshots subvolume at /.snapshots for snapshot storage
fileSystems."/.snapshots" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = [
"subvol=snapshots"
"compress=zstd"
];
};
{...}: {
# Configure snapper for automated snapshots
# Snapshots stored in nested .snapshots subvolumes within each service
services.snapper = {
# Enable snapper globally
configs = {