From db28833abc9c43e6efb48cc590ac8a0965838e63 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Fri, 7 Jul 2023 06:06:44 -0400 Subject: [PATCH] Setup zfs autosnapshot on levitation --- machines/levitation/configuration.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/machines/levitation/configuration.nix b/machines/levitation/configuration.nix index a0d9508..3f1f2b7 100644 --- a/machines/levitation/configuration.nix +++ b/machines/levitation/configuration.nix @@ -97,8 +97,24 @@ in { # ZFS boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; - boot.zfs.extraPools = [ "bigssd" ]; + boot.zfs = { + forceImportRoot = false; + extraPools = [ "bigssd" ]; + }; + services.zfs = { + autoScrub = { + enable = true; + interval = "Sun, 00:00"; + }; + autoSnapshot = { + enable = true; + frequent = 4; + hourly = 24; + daily = 7; + weekly = 2; + monthly = 2; + }; + }; # Generated with head -c4 /dev/urandom | od -A none -t x4 networking.hostId = "bc94e9d3"; }