feat: btrbk
This commit is contained in:
parent
fcc7c22739
commit
eab0bd8d10
3 changed files with 39 additions and 2 deletions
29
hosts/gwiad/btrbk.nix
Normal file
29
hosts/gwiad/btrbk.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.btrbk = {
|
||||||
|
instances.btrbk = {
|
||||||
|
onCalendar = "hourly";
|
||||||
|
settings = {
|
||||||
|
snapshot_dir = "@snapshots";
|
||||||
|
snapshot_create = "onchange";
|
||||||
|
incremental = "strict";
|
||||||
|
snapshot_preserve_min = "2d";
|
||||||
|
snapshot_preserve = "7d";
|
||||||
|
target_preserve_min = "3d";
|
||||||
|
target_preserve = "20d";
|
||||||
|
timestamp_format = "long-iso";
|
||||||
|
volume."/btr_pool" = {
|
||||||
|
target = "/run/media/jhemono/Gwiad PHD/Backup";
|
||||||
|
subvolume = {
|
||||||
|
"@home" = {
|
||||||
|
snapshot_name = "home";
|
||||||
|
target_preserve = "20d 15w *m";
|
||||||
|
};
|
||||||
|
"@var".snapshot_name = "var";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
# Services
|
||||||
|
./btrbk.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Boot configuration
|
# Boot configuration
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,20 @@
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/698c62d9-1115-4756-b812-1daae4898b83";
|
||||||
|
|
||||||
|
fileSystems."/btr_pool" =
|
||||||
|
{ device = "/dev/disk/by-uuid/c0db6860-b647-42eb-943f-892dde3847b2";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvolid=5" ];
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/c0db6860-b647-42eb-943f-892dde3847b2";
|
{ device = "/dev/disk/by-uuid/c0db6860-b647-42eb-943f-892dde3847b2";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=@" ];
|
options = [ "subvol=@" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/698c62d9-1115-4756-b812-1daae4898b83";
|
|
||||||
|
|
||||||
fileSystems."/home" =
|
fileSystems."/home" =
|
||||||
{ device = "/dev/disk/by-uuid/c0db6860-b647-42eb-943f-892dde3847b2";
|
{ device = "/dev/disk/by-uuid/c0db6860-b647-42eb-943f-892dde3847b2";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue