Some more sane defaults

This commit is contained in:
Filippo Berto 2023-02-15 09:03:44 +01:00
parent 02585b1f5e
commit a4b29ec259
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
6 changed files with 22 additions and 22 deletions

View 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;
};
}