blob: 748bb75c5fd83969dd3cec474409b44cee92eaa3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# Automatically performs a scrub on all btrfs filesystems configured in
# `config.fileSystems` on a daily schedule (by default). Activated by importing.
{ config, lib, ... }:
{
config = {
services = {
btrfs.autoScrub = {
enable = true;
interval = lib.mkDefault "*-*-* 03:30:00";
# gather all btrfs fileSystems, extra ones can be added via the NixOS
# module merging mechanism, of course.
fileSystems = lib.concatLists (
lib.mapAttrsToList
(
_:
{ fsType, mountPoint, ... }:
if fsType == "btrfs" then [ mountPoint ] else [ ]
)
config.fileSystems
);
};
};
};
}
|