nixos/msmtp: add package option

This commit is contained in:
Sandro Jäckel 2025-07-15 20:40:38 +02:00
parent aa7ef564b3
commit 22665bce7a
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -16,6 +16,8 @@ in
programs.msmtp = {
enable = lib.mkEnableOption "msmtp - an SMTP client";
package = lib.mkPackageOption pkgs "msmtp" { };
setSendmail = lib.mkOption {
type = lib.types.bool;
default = true;
@ -75,11 +77,11 @@ in
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.msmtp ];
environment.systemPackages = [ cfg.package ];
services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail {
program = "sendmail";
source = "${pkgs.msmtp}/bin/sendmail";
source = "${cfg.package}/bin/sendmail";
setuid = false;
setgid = false;
owner = "root";