mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
opensmtpd module: allow changing the package
This commit is contained in:
parent
4b649a99d8
commit
bb08686f1e
@ -10,7 +10,7 @@ let
|
|||||||
|
|
||||||
sendmail = pkgs.runCommand "opensmtpd-sendmail" {} ''
|
sendmail = pkgs.runCommand "opensmtpd-sendmail" {} ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
ln -s ${pkgs.opensmtpd}/sbin/smtpctl $out/bin/sendmail
|
ln -s ${cfg.package}/sbin/smtpctl $out/bin/sendmail
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
@ -27,6 +27,13 @@ in {
|
|||||||
description = "Whether to enable the OpenSMTPD server.";
|
description = "Whether to enable the OpenSMTPD server.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.opensmtpd;
|
||||||
|
defaultText = "pkgs.opensmtpd";
|
||||||
|
description = "The OpenSMTPD package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
addSendmailToSystemPath = mkOption {
|
addSendmailToSystemPath = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
@ -97,7 +104,7 @@ in {
|
|||||||
systemd.services.opensmtpd = let
|
systemd.services.opensmtpd = let
|
||||||
procEnv = pkgs.buildEnv {
|
procEnv = pkgs.buildEnv {
|
||||||
name = "opensmtpd-procs";
|
name = "opensmtpd-procs";
|
||||||
paths = [ pkgs.opensmtpd ] ++ cfg.procPackages;
|
paths = [ cfg.package ] ++ cfg.procPackages;
|
||||||
pathsToLink = [ "/libexec/opensmtpd" ];
|
pathsToLink = [ "/libexec/opensmtpd" ];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
@ -115,7 +122,7 @@ in {
|
|||||||
chown smtpq.root /var/spool/smtpd/purge
|
chown smtpq.root /var/spool/smtpd/purge
|
||||||
chmod 700 /var/spool/smtpd/purge
|
chmod 700 /var/spool/smtpd/purge
|
||||||
'';
|
'';
|
||||||
serviceConfig.ExecStart = "${pkgs.opensmtpd}/sbin/smtpd -d -f ${conf} ${args}";
|
serviceConfig.ExecStart = "${cfg.package}/sbin/smtpd -d -f ${conf} ${args}";
|
||||||
environment.OPENSMTPD_PROC_PATH = "${procEnv}/libexec/opensmtpd";
|
environment.OPENSMTPD_PROC_PATH = "${procEnv}/libexec/opensmtpd";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user