services.sanoid
This commit is contained in:
parent
d010634dd1
commit
078e9dd984
35
zfs.nix
35
zfs.nix
@ -26,20 +26,31 @@ in
|
|||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
boot.zfs.extraPools = [ service_configs.zpool ];
|
boot.zfs.extraPools = [ service_configs.zpool ];
|
||||||
|
|
||||||
|
services.sanoid = {
|
||||||
|
enable = true;
|
||||||
|
datasets."${service_configs.zpool}" = {
|
||||||
|
recursive = true;
|
||||||
|
autoprune = true;
|
||||||
|
autosnap = true;
|
||||||
|
hourly = 24;
|
||||||
|
daily = 30;
|
||||||
|
monthly = 12;
|
||||||
|
yearly = 4;
|
||||||
|
};
|
||||||
|
|
||||||
|
datasets."${service_configs.zpool}/services/sql" = {
|
||||||
|
recursive = true;
|
||||||
|
autoprune = true;
|
||||||
|
autosnap = true;
|
||||||
|
hourly = 12;
|
||||||
|
daily = 2;
|
||||||
|
monthly = 0;
|
||||||
|
yearly = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.zfs = {
|
services.zfs = {
|
||||||
autoScrub.enable = true;
|
autoScrub.enable = true;
|
||||||
trim.enable = true;
|
trim.enable = true;
|
||||||
# doesn't work, maybe replace with `services.sanoid` instead
|
|
||||||
autoSnapshot = {
|
|
||||||
# attempted to manually set zpool, didn't work
|
|
||||||
flags = "-k -p -P ${service_configs.zpool}";
|
|
||||||
|
|
||||||
enable = true;
|
|
||||||
frequent = 4; # 15-minutes
|
|
||||||
hourly = 24;
|
|
||||||
daily = 7;
|
|
||||||
weekly = 4;
|
|
||||||
monthly = 12;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user