Add firestar btrbk config
This commit is contained in:
parent
c84ad45f18
commit
a6aab259ac
2 changed files with 43 additions and 0 deletions
42
firestar/btrbk.nix
Normal file
42
firestar/btrbk.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -8,6 +8,7 @@
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
|
./btrbk.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./wireguard.nix
|
./wireguard.nix
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue