hosts: btrbk fix definitions/mount

This commit is contained in:
Kabbone 2023-01-15 19:12:35 +01:00
parent 01524a71c3
commit 15675bcc99
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
3 changed files with 90 additions and 57 deletions

View File

@ -32,19 +32,30 @@
]; ];
}; };
services.snapper.configs = { services.btrbk = {
home = { instances = {
subvolume = "/home"; hf = {
extraConfig = '' onCalendar = "hourly";
TIMELINE_CREATE=yes settings = {
TIMELINE_CLEANUP=yes incremental = "yes";
TIMELINE_LIMIT_HOURLY="5" snapshot_create = "ondemand";
TIMELINE_LIMIT_DAILY="5" snapshot_dir = "@snapshots";
TIMELINE_LIMIT_WEEKLY="2" timestamp_format = "long";
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0" snapshot_preserve = "2m 2w 5d 5h";
''; snapshot_preserve_min = "latest";
};
volume = {
"/mnt/snapshots/root" = {
snapshot_create = "always";
subvolume = {
"@home" = {};
};
};
};
};
};
};
}; };
fileSystems."/" = fileSystems."/" =
@ -59,12 +70,6 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
}; };
fileSystems."/home/.snapshots" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
};
fileSystems."/srv" = fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT"; { device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs"; fsType = "btrfs";
@ -77,6 +82,12 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
}; };
fileSystems."/mnt/snapshots/root" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT"; { device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat"; fsType = "vfat";

View File

@ -41,19 +41,30 @@
]; ];
}; };
services.snapper.configs = { services.btrbk = {
home = { instances = {
subvolume = "/home"; hf = {
extraConfig = '' onCalendar = "hourly";
TIMELINE_CREATE=yes settings = {
TIMELINE_CLEANUP=yes incremental = "yes";
TIMELINE_LIMIT_HOURLY="5" snapshot_create = "ondemand";
TIMELINE_LIMIT_DAILY="5" snapshot_dir = "@snapshots";
TIMELINE_LIMIT_WEEKLY="2" timestamp_format = "long";
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0" snapshot_preserve = "2m 2w 5d 5h";
''; snapshot_preserve_min = "latest";
};
volume = {
"/mnt/snapshots/root" = {
snapshot_create = "always";
subvolume = {
"@home" = {};
};
};
};
};
};
};
}; };
fileSystems."/" = fileSystems."/" =
@ -68,12 +79,6 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
}; };
fileSystems."/home/.snapshots" =
{ device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
};
fileSystems."/srv" = fileSystems."/srv" =
{ device = "/dev/mapper/root"; { device = "/dev/mapper/root";
fsType = "btrfs"; fsType = "btrfs";
@ -92,6 +97,12 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
}; };
fileSystems."/mnt/snapshots/root" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-label/BOOT"; { device = "/dev/disk/by-label/BOOT";
fsType = "vfat"; fsType = "vfat";

View File

@ -32,19 +32,30 @@
]; ];
}; };
services.snapper.configs = { services.btrbk = {
home = { instances = {
subvolume = "/home"; hf = {
extraConfig = '' onCalendar = "hourly";
TIMELINE_CREATE=yes settings = {
TIMELINE_CLEANUP=yes incremental = "yes";
TIMELINE_LIMIT_HOURLY="5" snapshot_create = "ondemand";
TIMELINE_LIMIT_DAILY="5" snapshot_dir = "@snapshots";
TIMELINE_LIMIT_WEEKLY="2" timestamp_format = "long";
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0" snapshot_preserve = "2m 2w 5d 5h";
''; snapshot_preserve_min = "latest";
};
volume = {
"/mnt/snapshots/root" = {
snapshot_create = "always";
subvolume = {
"@home" = {};
};
};
};
};
};
};
}; };
fileSystems."/" = fileSystems."/" =
@ -59,12 +70,6 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
}; };
fileSystems."/home/.snapshots" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots,discard=async" ];
};
fileSystems."/srv" = fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT"; { device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs"; fsType = "btrfs";
@ -77,6 +82,12 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
}; };
fileSystems."/mnt/snapshots/root" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
};
swapDevices = [ ]; swapDevices = [ ];