From 21a550bac77079aa7db4f9cf4d51110e951b4512 Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 21 Dec 2024 23:35:19 +0100 Subject: [PATCH] btrfs: init with scrubber and podman storage config --- services/btrfs.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 services/btrfs.nix diff --git a/services/btrfs.nix b/services/btrfs.nix new file mode 100644 index 0000000..20540ac --- /dev/null +++ b/services/btrfs.nix @@ -0,0 +1,18 @@ +{ lib, config, ... }: + +with lib; +mkIf (elem "btrfs" config.machine.services) { + services.btrfs.autoScrub = { + enable = true; + interval = "weekly"; + }; + + # use btrfs to store containers + virtualisation.containers.storage.settings = mkIf (elem "podman" config.machine.services) { + storage = { + driver = "btrfs"; + graphroot = "/var/lib/containers/storage"; + runroot = "/run/containers/storage"; + }; + }; +}