treewide: use lib.getExe' for config.services.postfix.package
This commit is contained in:
@@ -58,7 +58,7 @@ let
|
|||||||
# TODO: Should this be RFC42-ised so that users can set additional options without modifying the module?
|
# TODO: Should this be RFC42-ised so that users can set additional options without modifying the module?
|
||||||
postfixMtaConfig = pkgs.writeText "mailman-postfix.cfg" ''
|
postfixMtaConfig = pkgs.writeText "mailman-postfix.cfg" ''
|
||||||
[postfix]
|
[postfix]
|
||||||
postmap_command: ${config.services.postfix.package}/bin/postmap
|
postmap_command: ${lib.getExe' config.services.postfix.package "postmap"}
|
||||||
transport_file_type: hash
|
transport_file_type: hash
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ in
|
|||||||
};
|
};
|
||||||
preStart = ''
|
preStart = ''
|
||||||
${concatMapLines (createList cfg.listDomain) cfg.mailLists}
|
${concatMapLines (createList cfg.listDomain) cfg.mailLists}
|
||||||
${config.services.postfix.package}/bin/postmap /etc/postfix/virtual
|
${lib.getExe' config.services.postfix.package "postmap"} /etc/postfix/virtual
|
||||||
${config.services.postfix.package}/bin/postmap /etc/postfix/transport
|
${lib.getExe' config.services.postfix.package "postmap"} /etc/postfix/transport
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -889,7 +889,7 @@ in
|
|||||||
|
|
||||||
services.mail.sendmailSetuidWrapper = lib.mkIf config.services.postfix.setSendmail {
|
services.mail.sendmailSetuidWrapper = lib.mkIf config.services.postfix.setSendmail {
|
||||||
program = "sendmail";
|
program = "sendmail";
|
||||||
source = "${cfg.package}/bin/sendmail";
|
source = lib.getExe' cfg.package "sendmail";
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = setgidGroup;
|
group = setgidGroup;
|
||||||
setuid = false;
|
setuid = false;
|
||||||
@@ -898,7 +898,7 @@ in
|
|||||||
|
|
||||||
security.wrappers.mailq = {
|
security.wrappers.mailq = {
|
||||||
program = "mailq";
|
program = "mailq";
|
||||||
source = "${cfg.package}/bin/mailq";
|
source = lib.getExe' cfg.package "mailq";
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = setgidGroup;
|
group = setgidGroup;
|
||||||
setuid = false;
|
setuid = false;
|
||||||
@@ -907,7 +907,7 @@ in
|
|||||||
|
|
||||||
security.wrappers.postqueue = {
|
security.wrappers.postqueue = {
|
||||||
program = "postqueue";
|
program = "postqueue";
|
||||||
source = "${cfg.package}/bin/postqueue";
|
source = lib.getExe' cfg.package "postqueue";
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = setgidGroup;
|
group = setgidGroup;
|
||||||
setuid = false;
|
setuid = false;
|
||||||
@@ -916,7 +916,7 @@ in
|
|||||||
|
|
||||||
security.wrappers.postdrop = {
|
security.wrappers.postdrop = {
|
||||||
program = "postdrop";
|
program = "postdrop";
|
||||||
source = "${cfg.package}/bin/postdrop";
|
source = lib.getExe' cfg.package "postdrop";
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = setgidGroup;
|
group = setgidGroup;
|
||||||
setuid = false;
|
setuid = false;
|
||||||
@@ -965,13 +965,13 @@ in
|
|||||||
${lib.concatStringsSep "\n" (
|
${lib.concatStringsSep "\n" (
|
||||||
lib.mapAttrsToList (to: from: ''
|
lib.mapAttrsToList (to: from: ''
|
||||||
ln -sf ${from} /var/lib/postfix/conf/${to}
|
ln -sf ${from} /var/lib/postfix/conf/${to}
|
||||||
${cfg.package}/bin/postalias -o -p /var/lib/postfix/conf/${to}
|
${lib.getExe' cfg.package "postalias"} -o -p /var/lib/postfix/conf/${to}
|
||||||
'') cfg.aliasFiles
|
'') cfg.aliasFiles
|
||||||
)}
|
)}
|
||||||
${lib.concatStringsSep "\n" (
|
${lib.concatStringsSep "\n" (
|
||||||
lib.mapAttrsToList (to: from: ''
|
lib.mapAttrsToList (to: from: ''
|
||||||
ln -sf ${from} /var/lib/postfix/conf/${to}
|
ln -sf ${from} /var/lib/postfix/conf/${to}
|
||||||
${cfg.package}/bin/postmap -o -p /var/lib/postfix/conf/${to}
|
${lib.getExe' cfg.package "postmap"} -o -p /var/lib/postfix/conf/${to}
|
||||||
'') cfg.mapFiles
|
'') cfg.mapFiles
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -981,7 +981,7 @@ in
|
|||||||
ln -sf /var/spool/mail /var/
|
ln -sf /var/spool/mail /var/
|
||||||
|
|
||||||
#Finally delegate to postfix checking remain directories in /var/lib/postfix and set permissions on them
|
#Finally delegate to postfix checking remain directories in /var/lib/postfix and set permissions on them
|
||||||
${cfg.package}/bin/postfix set-permissions config_directory=/var/lib/postfix/conf
|
${lib.getExe' cfg.package "postfix"} set-permissions config_directory=/var/lib/postfix/conf
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1001,9 +1001,9 @@ in
|
|||||||
Type = "forking";
|
Type = "forking";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
PIDFile = "/var/lib/postfix/queue/pid/master.pid";
|
PIDFile = "/var/lib/postfix/queue/pid/master.pid";
|
||||||
ExecStart = "${cfg.package}/bin/postfix start";
|
ExecStart = "${lib.getExe' cfg.package "postfix"} start";
|
||||||
ExecStop = "${cfg.package}/bin/postfix stop";
|
ExecStop = "${lib.getExe' cfg.package "postfix"} stop";
|
||||||
ExecReload = "${cfg.package}/bin/postfix reload";
|
ExecReload = "${lib.getExe' cfg.package "postfix"} reload";
|
||||||
|
|
||||||
# Hardening
|
# Hardening
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
@@ -1039,10 +1039,10 @@ in
|
|||||||
meta_directory = "${cfg.package}/etc/postfix";
|
meta_directory = "${cfg.package}/etc/postfix";
|
||||||
command_directory = "${cfg.package}/bin";
|
command_directory = "${cfg.package}/bin";
|
||||||
sample_directory = "/etc/postfix";
|
sample_directory = "/etc/postfix";
|
||||||
newaliases_path = "${cfg.package}/bin/newaliases";
|
newaliases_path = lib.getExe' cfg.package "newaliases";
|
||||||
mailq_path = "${cfg.package}/bin/mailq";
|
mailq_path = lib.getExe' cfg.package "mailq";
|
||||||
readme_directory = false;
|
readme_directory = false;
|
||||||
sendmail_path = "${cfg.package}/bin/sendmail";
|
sendmail_path = lib.getExe' cfg.package "sendmail";
|
||||||
daemon_directory = "${cfg.package}/libexec/postfix";
|
daemon_directory = "${cfg.package}/libexec/postfix";
|
||||||
manpage_directory = "${cfg.package}/share/man";
|
manpage_directory = "${cfg.package}/share/man";
|
||||||
html_directory = "${cfg.package}/share/postfix/doc/html";
|
html_directory = "${cfg.package}/share/postfix/doc/html";
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ in
|
|||||||
})
|
})
|
||||||
// (lib.optionalAttrs (cfg.mta.type == "postfix") {
|
// (lib.optionalAttrs (cfg.mta.type == "postfix") {
|
||||||
sendmail_aliases = "${dataDir}/sympa_transport";
|
sendmail_aliases = "${dataDir}/sympa_transport";
|
||||||
aliases_program = "${config.services.postfix.package}/bin/postmap";
|
aliases_program = lib.getExe' config.services.postfix.package "postmap";
|
||||||
aliases_db_type = "hash";
|
aliases_db_type = "hash";
|
||||||
})
|
})
|
||||||
// (lib.optionalAttrs cfg.web.enable {
|
// (lib.optionalAttrs cfg.web.enable {
|
||||||
@@ -502,8 +502,8 @@ in
|
|||||||
''}
|
''}
|
||||||
|
|
||||||
${lib.optionalString (cfg.mta.type == "postfix") ''
|
${lib.optionalString (cfg.mta.type == "postfix") ''
|
||||||
${config.services.postfix.package}/bin/postmap hash:${dataDir}/virtual.sympa
|
${lib.getExe' config.services.postfix.package "postmap"} hash:${dataDir}/virtual.sympa
|
||||||
${config.services.postfix.package}/bin/postmap hash:${dataDir}/transport.sympa
|
${lib.getExe' config.services.postfix.package "postmap"} hash:${dataDir}/transport.sympa
|
||||||
''}
|
''}
|
||||||
${pkg}/bin/sympa_newaliases.pl
|
${pkg}/bin/sympa_newaliases.pl
|
||||||
${pkg}/bin/sympa.pl --health_check
|
${pkg}/bin/sympa.pl --health_check
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ in
|
|||||||
|
|
||||||
sendmailPath = mkOption {
|
sendmailPath = mkOption {
|
||||||
type = path;
|
type = path;
|
||||||
example = literalExpression ''"''${config.services.postfix.package}/bin/sendmail"'';
|
example = literalExpression ''lib.getExe' config.services.postfix.package "sendmail"'';
|
||||||
description = ''
|
description = ''
|
||||||
Path to {file}`sendmail` program.
|
Path to {file}`sendmail` program.
|
||||||
The default uses the local sendmail wrapper
|
The default uses the local sendmail wrapper
|
||||||
|
|||||||
Reference in New Issue
Block a user