{ lib, config, ... }: let workingDirectory = "/var/lib/private/crab-hole"; in { options.services.crab-hole.impermanence.enable = lib.mkOption { type = lib.types.bool; default = config.services.crab-hole.enable && config.storage.impermanence.enable; }; config = lib.mkIf config.services.crab-hole.enable { storage.datasets.replicate."system/root" = { directories."${workingDirectory}" = lib.mkIf config.services.crab-hole.impermanence.enable { owner.name = "crab-hole"; group.name = "crab-hole"; }; }; }; }