Add firestar btrbk config

This commit is contained in:
Aode 2023-02-28 23:08:07 -06:00
parent c84ad45f18
commit a6aab259ac
2 changed files with 43 additions and 0 deletions

42
firestar/btrbk.nix Normal file
View file

@ -0,0 +1,42 @@
{ pkgs, ... }:
let
volumeConfig = (subvolumes: {
snapshot_dir = "@snapshots";
subvolume = builtins.foldl'
(acc: subvol: acc // {
${subvol} = { };
})
{ }
subvolumes;
});
in
{
services.btrbk = {
sshAccess = [
{
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTqU3EvTgY5/e9m6YyQWypQPK58t9iPmPnPYAvnODGB asonix@lionheart";
roles = [ "source" "info" "send" ];
}
];
extraPackages = with pkgs; [ gzip ];
instances.btrbk = {
onCalendar = "hourly";
settings = {
snapshot_preserve_min = "2d";
snapshot_preserve = "7d 5w";
transaction_log = "/var/log/btrbk.log";
volume = {
"/btrfs/hdd" = volumeConfig [
"@documents"
"@downloads"
"@music"
"@pictures"
"@videos"
];
"/btrfs/nvme" = volumeConfig [ "@development" ];
};
};
};
};
}

View file

@ -8,6 +8,7 @@
imports =
[
# Include the results of the hardware scan.
./btrbk.nix
./hardware-configuration.nix
./wireguard.nix
];