From 1fe2075869d9b6e97696769fc28466c15d58b028 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 31 May 2024 11:27:48 +0200 Subject: [PATCH] pastila: enable zfs scrub/snapshot --- pastila/configuration.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pastila/configuration.nix b/pastila/configuration.nix index 04947a8..3f0deda 100644 --- a/pastila/configuration.nix +++ b/pastila/configuration.nix @@ -17,6 +17,22 @@ in boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/vda"; + # use the latest kernel compatible with zfs + boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + + # setup automatic snapshots (~short term: retain no more than 1 month) + services.zfs.autoSnapshot = { + enable = true; + frequent = 0; + monthly = 0; + }; + + # automatic scrub, 10th of each month at 3AM + services.zfs.autoScrub = { + enable = true; + interval = "*-*-10 03:00:00"; + }; + networking.hostName = "pastila"; # Define your hostname. networking.hostId = "8425e349";