nixos/msmtp: add package option (#425532)

authored by Sandro and committed by GitHub 12094020 142d1355

+4 -2
+4 -2
nixos/modules/programs/msmtp.nix
··· 16 16 programs.msmtp = { 17 17 enable = lib.mkEnableOption "msmtp - an SMTP client"; 18 18 19 + package = lib.mkPackageOption pkgs "msmtp" { }; 20 + 19 21 setSendmail = lib.mkOption { 20 22 type = lib.types.bool; 21 23 default = true; ··· 75 77 }; 76 78 77 79 config = lib.mkIf cfg.enable { 78 - environment.systemPackages = [ pkgs.msmtp ]; 80 + environment.systemPackages = [ cfg.package ]; 79 81 80 82 services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail { 81 83 program = "sendmail"; 82 - source = "${pkgs.msmtp}/bin/sendmail"; 84 + source = "${cfg.package}/bin/sendmail"; 83 85 setuid = false; 84 86 setgid = false; 85 87 owner = "root";