about summary refs log tree commit diff
path: root/users/sterni/modules/disk-checkup.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni/modules/disk-checkup.nix')
-rw-r--r--users/sterni/modules/disk-checkup.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/users/sterni/modules/disk-checkup.nix b/users/sterni/modules/disk-checkup.nix
new file mode 100644
index 000000000000..8acc08759b17
--- /dev/null
+++ b/users/sterni/modules/disk-checkup.nix
@@ -0,0 +1,25 @@
+# TODO(sterni): configure smartd and alerts
+{ config, lib, ... }:
+
+{
+  config = {
+    services = {
+      btrfs.autoScrub = {
+        enable = true;
+        interval = "daily";
+        # gather all btrfs fileSystems and overwrite default
+        fileSystems = lib.mkForce (
+          lib.concatLists (
+            lib.mapAttrsToList
+              (
+                _:
+                { fsType, mountPoint, ... }:
+                if fsType == "btrfs" then [ mountPoint ] else [ ]
+              )
+              config.fileSystems
+          )
+        );
+      };
+    };
+  };
+}