Some more sane defaults
This commit is contained in:
parent
02585b1f5e
commit
a4b29ec259
6 changed files with 22 additions and 22 deletions
14
nixos_modules/btrfs_scrub.nix
Normal file
14
nixos_modules/btrfs_scrub.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (builtins) mapAttrs attrValues;
|
||||
inherit (lib) filterAttrs unique;
|
||||
btrfsFileSystems =
|
||||
filterAttrs (_k: v: v.fsType == "btrfs") config.fileSystems;
|
||||
btrfsDevices =
|
||||
unique (attrValues (mapAttrs (_: v: v.device) btrfsFileSystems));
|
||||
in {
|
||||
services.btrfs.autoScrub = {
|
||||
enable = true;
|
||||
fileSystems = btrfsDevices;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue