{ lib, config, pkgs, ... }: let cfg = config.my.system.btrfsAutoscrub; in { options.my.system.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; }; }; }