diff options
Diffstat (limited to 'os/srv/zfs.nix')
| -rw-r--r-- | os/srv/zfs.nix | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/os/srv/zfs.nix b/os/srv/zfs.nix index fadfd82..3bfd2de 100644 --- a/os/srv/zfs.nix +++ b/os/srv/zfs.nix @@ -10,43 +10,51 @@ in 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=34359738368" ]; - supportedFilesystems = [ "zfs" ]; - initrd = { - supportedFilesystems = [ "zfs" ]; - # fileSystems."/mnt" = { - # device = "/dev/disk/by-label/KEYS"; - # fsType = "vfat"; - # options = [ "ro" ]; - # }; + kernelParams = [ "zfs.zfs_arc_max=${toString (32 * 1024 * 1024 * 1024)}" ]; + zfs = { + requestEncryptionCredentials = [ "zroot" ]; + useKeyringForCredentials = true; + extraPools = [ "tank" ]; }; + supportedFilesystems = [ "zfs" ]; + initrd.supportedFilesystems = [ "zfs" ]; }; services.zfs = { - autoScrub = { + expandOnBoot = "all"; + autoScrub.enable = true; + trim.enable = true; + autoSnapshot = { enable = true; - interval = "weekly"; + flags = "-k -p --utc"; }; - trim.enable = true; zed = { - enableMail = true; + enableCustomScripts = 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_NOTIFY_VERBOSE = 0; - ZED_USE_ENCLOSURE_LEDS = true; - ZED_SCRUB_AFTER_RESILVER = false; + 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"; }; } |
