about summary refs log blame commit diff
path: root/users/sterni/modules/disk-checkup.nix
blob: 8acc08759b178f2284829d084431f5426c1ed056 (plain) (tree)
























                                                                 
# 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
          )
        );
      };
    };
  };
}