nixos-config/configurations/camelot/zfs.nix

52 lines
1.1 KiB
Nix

{
config,
extraInfo,
pkgs,
...
}:
{
boot.supportedFilesystems = [ "zfs" ];
boot.zfs.forceImportRoot = false;
networking.hostId = "c97cef07";
boot.zfs.extraPools = [ "pool" ];
services.zfs = {
autoScrub.enable = true;
trim.enable = true;
};
programs.msmtp = {
enable = true;
setSendmail = true;
defaults = {
aliases = "/etc/aliases";
port = 465;
tls_trust_file = "/etc/ssl/certs/ca-certificates.crt";
tls = "on";
auth = "login";
tls_starttls = "off";
};
accounts = {
default = {
host = extraInfo.mail.zfs.smtpServer;
passwordeval = "cat ${config.age.secrets.zfsMail.path}";
user = extraInfo.mail.zfs.address;
from = extraInfo.mail.zfs.address;
};
};
};
services.zfs.zed.settings = {
ZED_DEBUG_LOG = "/tmp/zed.debug.log";
ZED_EMAIL_ADDR = [ "root" ];
ZED_EMAIL_PROG = "${pkgs.msmtp}/bin/msmtp";
ZED_EMAIL_OPTS = extraInfo.mail.personal.address;
ZED_NOTIFY_INTERVAL_SECS = 3600;
ZED_NOTIFY_VERBOSE = true;
ZED_USE_ENCLOSURE_LEDS = true;
ZED_SCRUB_AFTER_RESILVER = true;
};
}