mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-11-17 21:51:03 +01:00
* feat(btrbk): make snapshots explicit and guarded Replace the always-on, hardcoded module with modules.btrbk options (enable/volume/subvolume/snapshotDir/target/onCalendar), and assert the btrfs top-level subvolume is mounted so a missing mount fails evaluation instead of silently failing at runtime. Store snapshots in the @snapshots subvolume (snapshot_dir=@snapshots) rather than next to the live subvolume, make the off-host target explicit and off by default, and document that local snapshots are not off-host backups. Enable the feature explicitly on idols-ai, shoukei and the three kubevirt hosts; qemu-guest now disables it through the option. Add eval tests for shoukei and ai. * feat(monitoring): alert on btrbk snapshot failure Add HostBtrbkSnapshotFailed on node_systemd_unit_state for btrbk-btrbk.service, so a broken snapshot schedule alerts instead of only surfacing in the journal.
16 lines
488 B
Nix
16 lines
488 B
Nix
{ outputs, ... }:
|
|
let
|
|
cfg = outputs.nixosConfigurations.shoukei-niri.config;
|
|
instance = cfg.services.btrbk.instances.btrbk;
|
|
volume = instance.settings.volume."/btr_pool";
|
|
in
|
|
{
|
|
enabled = cfg.modules.btrbk.enable;
|
|
hasBtrPool = cfg.fileSystems ? "/btr_pool";
|
|
onCalendar = instance.onCalendar;
|
|
snapshotDir = volume.snapshot_dir;
|
|
sources = builtins.attrNames volume.subvolume;
|
|
snapshotCreate = volume.subvolume."@persistent".snapshot_create;
|
|
hasTarget = volume ? target;
|
|
}
|