From b7bc6f0458bce2adc1fa63ae2c88523a1f42beb3 Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 27 Aug 2024 11:45:42 -0400 Subject: [PATCH] Dimaga: add weekly RAID array scrub --- hosts/Dimaga/hardware-configuration.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hosts/Dimaga/hardware-configuration.nix b/hosts/Dimaga/hardware-configuration.nix index d37971a..7f92ed9 100644 --- a/hosts/Dimaga/hardware-configuration.nix +++ b/hosts/Dimaga/hardware-configuration.nix @@ -51,6 +51,25 @@ in }; }; + # Automatically scrub the RAID array weekly + systemd.services."raid-scrub" = { + description = "Periodically scrub RAID volumes for errors."; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + script = "echo check > /sys/block/md0/md/sync_action"; + }; + systemd.timers."raid-scrub" = { + description = "Periodically scrub RAID volumes for errors."; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "weekly"; + Persistent = true; + Unit = "raid-scrub.service"; + }; + }; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; # Detect keyboard as "internal" so we can automatically disable the touchpad while typing