36 lines
745 B
Nix
36 lines
745 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.btrfsAutoscrub;
|
|
in
|
|
{
|
|
options.btrfsAutoscrub = {
|
|
enable = lib.mkEnableOption "Enable BTRFS Auto Scrub module";
|
|
|
|
interval = lib.mkOption {
|
|
default = "weekly";
|
|
type = config.services.btrfs.autoScrub.interval.type;
|
|
description = config.services.btrfs.autoScrub.interval.description;
|
|
};
|
|
|
|
fileSystems = lib.mkOption {
|
|
default = [ ];
|
|
type = config.services.btrfs.autoScrub.fileSystems.type;
|
|
description = config.services.btrfs.autoScrub.fileSystems.description;
|
|
};
|
|
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.btrfs.autoScrub = {
|
|
enable = true;
|
|
interval = cfg.interval;
|
|
fileSystems = cfg.interval;
|
|
};
|
|
};
|
|
|
|
}
|