Files
nix/modules/homelab/fileshare/zfs/default.nix
2025-10-13 22:18:10 -05:00

37 lines
656 B
Nix

{
pkgs,
config,
lib,
...
}: let
cfg = config.fileshare.zfs;
in {
options.fileshare.zfs = {
enable = lib.mkEnableOption "enables zfs";
};
config = lib.mkIf cfg.enable {
# set network host id
networking.hostId = "3e6e7055";
# enable zfs support
boot.kernelModules = ["zfs"];
boot.supportedFilesystems = ["zfs"];
# enable smart monitoring
services.smartd.enable = true;
# enable zfs
services.zfs = {
autoScrub.enable = true;
autoScrub.interval = "weekly";
};
fileSystems."/holocron" = {
device = "holocron";
fsType = "zfs";
options = ["nofail"];
};
};
}