summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/exim-smarthost.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-07-27 10:58:39 +0200
committermakefu <github@syntax-fehler.de>2016-07-27 10:58:39 +0200
commit041eeaa4c9924d571d6977112ed7f0ebf7d0791c (patch)
treebb58908e6113917096a476cadf98ee5065b0ca83 /krebs/3modules/exim-smarthost.nix
parent88a220f78825c1bfc60f0e885e02eacc0b7cd6a9 (diff)
parentb139155bee6006f21993f3b2b6bfd5adde6fff6f (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/3modules/exim-smarthost.nix')
-rw-r--r--krebs/3modules/exim-smarthost.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/krebs/3modules/exim-smarthost.nix b/krebs/3modules/exim-smarthost.nix
index aba6ee0b5..cfe2e5f04 100644
--- a/krebs/3modules/exim-smarthost.nix
+++ b/krebs/3modules/exim-smarthost.nix
@@ -2,6 +2,7 @@
with config.krebs.lib;
let
+ indent = replaceChars ["\n"] ["\n "];
cfg = config.krebs.exim-smarthost;
out = {
@@ -12,6 +13,11 @@ let
api = {
enable = mkEnableOption "krebs.exim-smarthost";
+ authenticators = mkOption {
+ type = types.attrsOf types.str;
+ default = {};
+ };
+
dkim = mkOption {
type = types.listOf (types.submodule ({ config, ... }: {
options = {
@@ -80,6 +86,16 @@ let
default = [];
};
+ ssl_cert = mkOption {
+ type = types.nullOr types.str;
+ default = null;
+ };
+
+ ssl_key = mkOption {
+ type = types.nullOr types.str;
+ default = null;
+ };
+
system-aliases = mkOption {
type = types.listOf (types.submodule ({
options = {
@@ -136,7 +152,9 @@ let
syslog_timestamp = false
syslog_duplication = false
- tls_advertise_hosts =
+ ${optionalString (cfg.ssl_cert != null) "tls_certificate = ${cfg.ssl_cert}"}
+ ${optionalString (cfg.ssl_key != null) "tls_privatekey = ${cfg.ssl_key}"}
+ tls_advertise_hosts =${optionalString (cfg.ssl_cert != null) " *"}
begin acl
@@ -257,6 +275,10 @@ let
begin rewrite
begin authenticators
+ ${concatStringsSep "\n" (mapAttrsToList (name: text: ''
+ ${name}:
+ ${indent text}
+ '') cfg.authenticators)}
'';
};
};