feat(sterni/machines/edwin): enable btrfs autoscrub
Small module that regularly runs btrfs scrub on all btrfs filesystems. Eventually the module should also do SMART value monitoring, as edwin is a server from Hetzner's server auction, so a disk failure may not be too far away. Change-Id: I11e423a5d91c99ad455c2bb29b632efb79ef908e Reviewed-on: https://cl.tvl.fyi/c/depot/+/7294 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
This commit is contained in:
parent
2490ce968c
commit
b4c0c40f63
2 changed files with 26 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./network.nix
|
./network.nix
|
||||||
# These modules configure services, websites etc.
|
# These modules configure services, websites etc.
|
||||||
|
../../modules/disk-checkup.nix
|
||||||
./minecraft.nix
|
./minecraft.nix
|
||||||
./gopher.nix
|
./gopher.nix
|
||||||
./http/sterni.lv.nix
|
./http/sterni.lv.nix
|
||||||
|
|
25
users/sterni/modules/disk-checkup.nix
Normal file
25
users/sterni/modules/disk-checkup.nix
Normal file
|
@ -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
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue