Files
ryan4yin | 二花 f8d12ada24 feat(btrbk): make snapshots explicit, guarded, and stored in @snapshots (#271)
* 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.
2026-09-19 11:43:11 +08:00

48 lines
1.4 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
lib,
myvars,
...
}:
#############################################################
#
# Shoukei - NixOS running on Macbook Pro 2022 M2 16G
#
#############################################################
let
hostName = "shoukei"; # Define your hostname.
in
{
imports = [
./hardware-configuration.nix
../idols-ai/preservation.nix
];
# disable sunshine for securrity
services.sunshine.enable = lib.mkForce false;
services.tuned.ppdSettings.main.default = lib.mkForce "power-saver";
# Laptop joins untrusted networks and is no longer scraped; don't expose :9100.
services.prometheus.exporters.node.enable = lib.mkForce false;
networking = {
inherit hostName;
inherit (myvars.networking) nameservers;
};
fileSystems."/btr_pool" = {
device = "/dev/disk/by-uuid/c2e8b249-240e-4eef-bf4e-81e7dbbf4887";
fsType = "btrfs";
options = [ "subvolid=5" ];
};
modules.btrbk.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.11"; # Did you read the comment?
}