Flake: cleanup
This commit is contained in:
parent
016bf7c189
commit
a4fa0c206a
7 changed files with 47 additions and 155 deletions
15
nixos_modules/btrfs-scrub.nix
Normal file
15
nixos_modules/btrfs-scrub.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ 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 = btrfsDevices != [ ];
|
||||
fileSystems = btrfsDevices;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue