From 03d5ffd2ded360341a024dd796a8b27680cfb037 Mon Sep 17 00:00:00 2001 From: sterni Date: Sun, 26 Nov 2023 12:54:19 +0100 Subject: feat(sterni/ingeborg): enable btrfs auto scrub While we are at it, rename disk-checkup.nix to btrfs-auto-scrub.nix and move it into //ops/modules. I originally wanted to have additionally disk health related services in that module, but the btrfs scrub functionality is nicely self-contained and reusable, so I think it makes sense to have this in a more central location. Change-Id: Iabdd62838eef009540ca71abafd921afda2a9b47 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10128 Reviewed-by: sterni Autosubmit: sterni Tested-by: BuildkiteCI --- users/sterni/machines/edwin/default.nix | 2 +- users/sterni/machines/ingeborg/default.nix | 2 ++ users/sterni/modules/disk-checkup.nix | 25 ------------------------- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 users/sterni/modules/disk-checkup.nix (limited to 'users/sterni') diff --git a/users/sterni/machines/edwin/default.nix b/users/sterni/machines/edwin/default.nix index 0204cc463e..16951d04f9 100644 --- a/users/sterni/machines/edwin/default.nix +++ b/users/sterni/machines/edwin/default.nix @@ -10,7 +10,7 @@ ./hardware.nix ./network.nix # These modules configure services, websites etc. - ../../modules/disk-checkup.nix + (depot.path.origSrc + "/ops/modules/btrfs-auto-scrub.nix") ./minecraft.nix ./gopher.nix ./http/sterni.lv.nix diff --git a/users/sterni/machines/ingeborg/default.nix b/users/sterni/machines/ingeborg/default.nix index 3012e5f4af..8c512eac3b 100644 --- a/users/sterni/machines/ingeborg/default.nix +++ b/users/sterni/machines/ingeborg/default.nix @@ -7,6 +7,8 @@ # These modules touch things related to booting (filesystems, initrd network…) ./hardware.nix ./network.nix + # (More or less) pluggable service configuration + (depot.path.origSrc + "/ops/modules/btrfs-auto-scrub.nix") ]; config = { diff --git a/users/sterni/modules/disk-checkup.nix b/users/sterni/modules/disk-checkup.nix deleted file mode 100644 index 8acc08759b..0000000000 --- a/users/sterni/modules/disk-checkup.nix +++ /dev/null @@ -1,25 +0,0 @@ -# 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 - ) - ); - }; - }; - }; -} -- cgit 1.4.1