summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lahfa <masterancpp@gmail.com>2023-12-18 10:32:58 +0100
committerGitHub <noreply@github.com>2023-12-18 10:32:58 +0100
commited66c68205cccbec96de2a63b73c83b986e6c63f (patch)
tree00e7ba329445e7677db15197bebd53e50cd3b8d4
parentMerge pull request #265857 from 999eagle/feat/invidious-scale (diff)
parentnixos/zed: use global sendmail if configured (diff)
downloadnixpkgs-ed66c68205cccbec96de2a63b73c83b986e6c63f.tar.gz
Merge pull request #275028 from pacien/zfs-zed-sendmail
-rw-r--r--nixos/doc/manual/release-notes/rl-2405.section.md3
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix28
2 files changed, 19 insertions, 12 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md
index 34b1fd1f3685..0cbb98199c55 100644
--- a/nixos/doc/manual/release-notes/rl-2405.section.md
+++ b/nixos/doc/manual/release-notes/rl-2405.section.md
@@ -85,6 +85,9 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- [](#opt-boot.kernel.sysctl._net.core.wmem_max_) changed from a string to an integer because of the addition of a custom merge option (taking the highest value defined to avoid conflicts between 2 services trying to set that value), just as [](#opt-boot.kernel.sysctl._net.core.rmem_max_) since 22.11.
+- `services.zfs.zed.enableMail` now uses the global `sendmail` wrapper defined by an email module
+ (such as msmtp or Postfix). It no longer requires using a special ZFS build with email support.
+
- Gitea 1.21 upgrade has several breaking changes, including:
- Custom themes and other assets that were previously stored in `custom/public/*` now belong in `custom/public/assets/*`
- New instances of Gitea using MySQL now ignore the `[database].CHARSET` config option and always use the `utf8mb4` charset, existing instances should migrate via the `gitea doctor convert` CLI command.
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index 784040f0ce9e..fc9420fb8d28 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -508,9 +508,15 @@ in
};
services.zfs.zed = {
- enableMail = mkEnableOption (lib.mdDoc "ZED's ability to send emails") // {
- default = cfgZfs.package.enableMail;
- defaultText = literalExpression "config.${optZfs.package}.enableMail";
+ enableMail = mkOption {
+ type = types.bool;
+ default = config.services.mail.sendmailSetuidWrapper != null;
+ defaultText = literalExpression ''
+ config.services.mail.sendmailSetuidWrapper != null
+ '';
+ description = mdDoc ''
+ Whether to enable ZED's ability to send emails.
+ '';
};
settings = mkOption {
@@ -551,14 +557,6 @@ in
message = "The kernel module and the userspace tooling versions are not matching, this is an unsupported usecase.";
}
{
- assertion = cfgZED.enableMail -> cfgZfs.package.enableMail;
- message = ''
- To allow ZED to send emails, ZFS needs to be configured to enable
- this. To do so, one must override the `zfs` package and set
- `enableMail` to true.
- '';
- }
- {
assertion = config.networking.hostId != null;
message = "ZFS requires networking.hostId to be set";
}
@@ -671,7 +669,13 @@ in
};
services.zfs.zed.settings = {
- ZED_EMAIL_PROG = mkIf cfgZED.enableMail (mkDefault "${pkgs.mailutils}/bin/mail");
+ ZED_EMAIL_PROG = mkIf cfgZED.enableMail (mkDefault (
+ config.security.wrapperDir + "/" +
+ config.services.mail.sendmailSetuidWrapper.program
+ ));
+ # subject in header for sendmail
+ ZED_EMAIL_OPTS = mkIf cfgZED.enableMail (mkDefault "@ADDRESS@");
+
PATH = lib.makeBinPath [
cfgZfs.package
pkgs.coreutils