diff options
Diffstat (limited to 'users/sterni')
-rw-r--r-- | users/sterni/machines/edwin/default.nix | 1 | ||||
-rw-r--r-- | users/sterni/modules/disk-checkup.nix | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/users/sterni/machines/edwin/default.nix b/users/sterni/machines/edwin/default.nix index 40700ea1e91b..ebf691c8d9ab 100644 --- a/users/sterni/machines/edwin/default.nix +++ b/users/sterni/machines/edwin/default.nix @@ -8,6 +8,7 @@ ./hardware.nix ./network.nix # These modules configure services, websites etc. + ../../modules/disk-checkup.nix ./minecraft.nix ./gopher.nix ./http/sterni.lv.nix diff --git a/users/sterni/modules/disk-checkup.nix b/users/sterni/modules/disk-checkup.nix new file mode 100644 index 000000000000..8acc08759b17 --- /dev/null +++ b/users/sterni/modules/disk-checkup.nix @@ -0,0 +1,25 @@ +# TODO(sterni): configure smartd and alerts +{ config, lib, ... }: + +{ + config = { + services = { + btrfs.autoScrub = { + enable = true; + interval = "daily"; + # gather all btrfs fileSystems and overwrite default + fileSystems = lib.mkForce ( + lib.concatLists ( + lib.mapAttrsToList + ( + _: + { fsType, mountPoint, ... }: + if fsType == "btrfs" then [ mountPoint ] else [ ] + ) + config.fileSystems + ) + ); + }; + }; + }; +} |