diff options
| author | adikro <adikro@disroot.org> | 2026-06-29 00:31:26 +0200 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2026-06-29 00:31:26 +0200 |
| commit | 8a820cacee1ff07ae7397d053b26e66f7086a4a4 (patch) | |
| tree | 23153683130799babd4e5ed1a39068c52fa7d588 /os/srv/zfs.nix | |
| parent | 9b8f9a4bf5e13efe49ec101f127d0df3d7bb3cf3 (diff) | |
Diffstat (limited to 'os/srv/zfs.nix')
| -rw-r--r-- | os/srv/zfs.nix | 60 |
1 files changed, 0 insertions, 60 deletions
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"; - }; -} |
