mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-10 09:43:30 +01:00
nixos/msmtp: add package option
This commit is contained in:
parent
aa7ef564b3
commit
22665bce7a
|
|
@ -16,6 +16,8 @@ in
|
||||||
programs.msmtp = {
|
programs.msmtp = {
|
||||||
enable = lib.mkEnableOption "msmtp - an SMTP client";
|
enable = lib.mkEnableOption "msmtp - an SMTP client";
|
||||||
|
|
||||||
|
package = lib.mkPackageOption pkgs "msmtp" { };
|
||||||
|
|
||||||
setSendmail = lib.mkOption {
|
setSendmail = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
|
@ -75,11 +77,11 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = [ pkgs.msmtp ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail {
|
services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail {
|
||||||
program = "sendmail";
|
program = "sendmail";
|
||||||
source = "${pkgs.msmtp}/bin/sendmail";
|
source = "${cfg.package}/bin/sendmail";
|
||||||
setuid = false;
|
setuid = false;
|
||||||
setgid = false;
|
setgid = false;
|
||||||
owner = "root";
|
owner = "root";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue