hosts: move from snapper to btrbk

This commit is contained in:
Kabbone 2023-01-14 20:12:30 +01:00
parent b8af14371f
commit c9544ceabf
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
2 changed files with 41 additions and 163 deletions

View File

@ -94,12 +94,6 @@
options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2" ]; options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2" ];
}; };
# fileSystems."/mnt/Pluto" =
# { device = "nas:/Pluto/nix";
# fsType = "nfs";
# options = [ "noauto,users,x-systemd.automount,x-systemd.device-timeout=10,soft,timeo=14,x-systemd.idle-timeout=1min,sec=sys,exec,nfsvers=4.2,local_lock=all" ];
# };
swapDevices = [ ]; swapDevices = [ ];

View File

@ -44,109 +44,35 @@
fileSystems = [ fileSystems = [
"/" "/"
"/mnt/Pluto" "/mnt/Pluto"
"/mnt/Mars" # "/mnt/Mars"
]; ];
}; };
services.snapper.configs = { services.btrbk = {
home = { instances = {
subvolume = "/home"; hf = {
extraConfig = '' settings = {
TIMELINE_CREATE=yes incremental = yes;
TIMELINE_CLEANUP=yes snapshot_create = "ondemand";
TIMELINE_LIMIT_HOURLY="5" snapshot_dir = "/mnt/snapshots";
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="2" snapshot_preserve = "2m 2w 5d 5h";
TIMELINE_LIMIT_MONTHLY="2" snapshot_preserve_min = "latest";
TIMELINE_LIMIT_YEARLY="0"
''; onCalender = "hourly";
}; volume = {
mars_home = { "/" = {
subvolume = "/mnt/Mars/Home"; snapshot_dir = /mnt/snapshots/root;
extraConfig = '' snapshot_create = "always";
TIMELINE_CREATE=yes subvolume = "@home";
TIMELINE_CLEANUP=yes };
TIMELINE_LIMIT_HOURLY="5" };
TIMELINE_LIMIT_DAILY="5" };
TIMELINE_LIMIT_WEEKLY="2" };
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
pluto_backups = {
subvolume = "/mnt/Pluto/Backups";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="3"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
pluto_games = {
subvolume = "/mnt/Pluto/Games";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
pluto_it = {
subvolume = "/mnt/Pluto/IT";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="5"hm
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
pluto_media = {
subvolume = "/mnt/Pluto/Media";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
pluto_pictures = {
subvolume = "/mnt/Pluto/Pictures";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
};
pluto_rest = {
subvolume = "/mnt/Pluto/Rest";
extraConfig = ''
TIMELINE_CREATE=yes
TIMELINE_CLEANUP=yes
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="2"
TIMELINE_LIMIT_MONTHLY="2"
TIMELINE_LIMIT_YEARLY="0"
'';
}; };
}; };
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT"; { device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs"; fsType = "btrfs";
@ -159,12 +85,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";
@ -177,66 +97,36 @@
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,subvol=@snapshots,discard=async" ];
};
fileSystems."/mnt/snapshots/Mars" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots/mars/home,discard=async" ];
};
fileSystems."/mnt/snapshots/Pluto" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots" ];
};
fileSystems."/mnt/Pluto" = fileSystems."/mnt/Pluto" =
{ device = "/dev/disk/by-label/NAS-RAID"; { device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs"; fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@" ]; options = [ "compress=zstd,space_cache=v2,noatime,subvol=@" ];
}; };
fileSystems."/mnt/Pluto/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots" ];
};
fileSystems."/mnt/Pluto/Backups/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots/Backups" ];
};
fileSystems."/mnt/Pluto/Games/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots/Games" ];
};
fileSystems."/mnt/Pluto/IT/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots/IT" ];
};
fileSystems."/mnt/Pluto/Media/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots/Media" ];
};
fileSystems."/mnt/Pluto/Pictures/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots/Pictures" ];
};
fileSystems."/mnt/Pluto/Rest/.snapshots" =
{ device = "/dev/disk/by-label/NAS-RAID";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,noatime,subvol=@snapshots/Rest" ];
};
fileSystems."/mnt/Mars" = fileSystems."/mnt/Mars" =
{ device = "/dev/disk/by-label/NIXROOT"; { device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs"; fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nas,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nas,discard=async" ];
}; };
fileSystems."/mnt/Mars/Home/.snapshots" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@snapshots/mars/Home,discard=async" ];
};
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT"; { device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat"; fsType = "vfat";
@ -252,12 +142,6 @@
options = [ "bind" ]; options = [ "bind" ];
}; };
fileSystems."/export/Nix" =
{ device = "/nix";
options = [ "bind" ];
};
swapDevices = [ ]; swapDevices = [ ];
networking = { networking = {