From 8a820cacee1ff07ae7397d053b26e66f7086a4a4 Mon Sep 17 00:00:00 2001 From: adikro Date: Mon, 29 Jun 2026 00:31:26 +0200 Subject: updated some stuff, added persistance --- os/srv/zfs.nix | 60 ---------------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 os/srv/zfs.nix (limited to 'os/srv/zfs.nix') diff --git a/os/srv/zfs.nix b/os/srv/zfs.nix deleted file mode 100644 index 3bfd2de..0000000 --- a/os/srv/zfs.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ 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"; - } - { - assertion = config.os.srv.sops.enable; - message = "required for storing the ntfy token"; - } - ]; - - sops.secrets."ntfy/zed".neededForUsers = false; - - boot = { - kernelParams = [ "zfs.zfs_arc_max=${toString (32 * 1024 * 1024 * 1024)}" ]; - zfs = { - requestEncryptionCredentials = [ "zroot" ]; - useKeyringForCredentials = true; - extraPools = [ "tank" ]; - }; - supportedFilesystems = [ "zfs" ]; - initrd.supportedFilesystems = [ "zfs" ]; - }; - services.zfs = { - expandOnBoot = "all"; - autoScrub.enable = true; - trim.enable = true; - autoSnapshot = { - enable = true; - flags = "-k -p --utc"; - }; - zed = { - enableCustomScripts = true; - settings = { - ZED_DEBUG_LOG = "/var/log/zed.debug.log"; - - ZED_NOTIFY_INTERVAL_SECS = 3600; - ZED_NOTIFY_VERBOSE = 0; - - ZED_USE_ENCLOSURE_LEDS = 1; - ZED_SCRUB_AFTER_RESILVER = 1; - ZED_POWER_OFF_ENCLOSURE_SLOT_ON_FAULT = 1; - ZED_POWER_OFF_ENCLOSURE_SLOT_ON_DEADMAN = 1; - - ZED_NTFY_TOPIC = "zed-alerts-bibus-lab"; - ZED_NTFY_URL = "http://${config.os.core.network.ips.monitor-vm}:8085"; - }; - }; - }; - systemd.services.zfs-zed.serviceConfig.EnvironmentFile = config.sops.secrets."ntfy/zed".path; - networking.hostId = "4e3e22e1"; - }; -} -- cgit v1.3