diff options
| author | adikro <adikro@disroot.org> | 2026-05-18 15:25:50 +0200 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2026-05-18 15:25:50 +0200 |
| commit | c6b6a3e6c702834eac2b633db2ed4c397b4ae113 (patch) | |
| tree | 4ec03c63fac3c7d0e7caea31cbe9ec1317df8c2f /os/srv/zfs.nix | |
| parent | 62b7ca3cdfff5182daad7f4092b6861bbc93f04c (diff) | |
set up disko, zfs, clamav aide, backup, nfs, zfs for oci and ups
Diffstat (limited to 'os/srv/zfs.nix')
| -rw-r--r-- | os/srv/zfs.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/os/srv/zfs.nix b/os/srv/zfs.nix new file mode 100644 index 0000000..fadfd82 --- /dev/null +++ b/os/srv/zfs.nix @@ -0,0 +1,52 @@ +{ config, lib, ... }: +let + cfg = config.os.srv.zfs; +in +{ + options.os.srv.zfs.enable = lib.mkEnableOption "enables zfs drive maintnance"; + config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = config.os.core.drivers.kernel == "zfs"; + message = "ZFS requires the zfs supported kernel"; + } + ]; + boot = { + kernelParams = [ "zfs.zfs_arc_max=34359738368" ]; + supportedFilesystems = [ "zfs" ]; + initrd = { + supportedFilesystems = [ "zfs" ]; + # fileSystems."/mnt" = { + # device = "/dev/disk/by-label/KEYS"; + # fsType = "vfat"; + # options = [ "ro" ]; + # }; + }; + }; + services.zfs = { + autoScrub = { + enable = true; + interval = "weekly"; + }; + trim.enable = true; + zed = { + enableMail = true; + settings = { + ZED_DEBUG_LOG = "/var/log/zed.debug.log"; + + ZED_EMAIL_ADDR = [ "adikro@disroot.org" ]; + ZED_EMAIL_PROG = "mail"; + ZED_EMAIL_OPTS = "-s '@SUBJECT@' @ADDRESS@"; + + ZED_NOTIFY_INTERVAL_SECS = 3600; + ZED_NOTIFY_VERBOSE = false; + + ZED_USE_ENCLOSURE_LEDS = true; + ZED_SCRUB_AFTER_RESILVER = false; + + }; + }; + }; + networking.hostId = "4e3e22e1"; + }; +} |
