2024-02-12 14:57:13 +01:00
|
|
|
{ config, ... }: {
|
|
|
|
# {{{ Zfs config
|
|
|
|
services.zfs = {
|
|
|
|
trim.enable = true;
|
|
|
|
autoScrub.enable = true;
|
2024-02-12 15:05:07 +01:00
|
|
|
};
|
|
|
|
# }}}
|
|
|
|
# {{{ Sanoid config
|
|
|
|
# Sanoid allows me to configure snapshot frequency on a per-dataset basis.
|
|
|
|
services.sanoid = {
|
|
|
|
enable = true;
|
2024-02-12 14:57:13 +01:00
|
|
|
|
2024-02-12 15:05:07 +01:00
|
|
|
# {{{ Data
|
2024-02-12 15:39:55 +01:00
|
|
|
datasets."zroot/root/persist/data" = {
|
2024-02-12 15:05:07 +01:00
|
|
|
autosnap = true;
|
|
|
|
autoprune = true;
|
|
|
|
recursive = true;
|
|
|
|
yearly = 0;
|
|
|
|
monthly = 12;
|
|
|
|
weekly = 4;
|
|
|
|
daily = 7;
|
|
|
|
hourly = 24;
|
2024-02-12 14:57:13 +01:00
|
|
|
};
|
2024-02-12 15:05:07 +01:00
|
|
|
# }}}
|
|
|
|
# {{{ State
|
2024-02-12 15:39:55 +01:00
|
|
|
datasets."zroot/root/persist/state" = {
|
2024-02-12 15:05:07 +01:00
|
|
|
autosnap = true;
|
|
|
|
autoprune = true;
|
|
|
|
recursive = true;
|
|
|
|
yearly = 0;
|
|
|
|
monthly = 1;
|
|
|
|
weekly = 1;
|
|
|
|
daily = 3;
|
|
|
|
hourly = 6;
|
|
|
|
};
|
|
|
|
# }}}
|
2024-02-12 14:57:13 +01:00
|
|
|
};
|
|
|
|
# }}}
|
2024-05-21 01:37:39 +02:00
|
|
|
# {{{ Syncoid
|
|
|
|
# Automatically sync certain snapshot to rsync.net
|
|
|
|
services.syncoid = {
|
|
|
|
enable = true;
|
|
|
|
commands."zroot/root/persist/data".target = "root@rsync.net:zroot/root/persist/data";
|
|
|
|
commands."zroot/root/persist/state".target = "root@rsync.net:zroot/root/persist/state";
|
|
|
|
};
|
|
|
|
# }}}
|
2024-02-12 14:57:13 +01:00
|
|
|
}
|