summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/exim-retiolum.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules/exim-retiolum.nix')
-rw-r--r--krebs/3modules/exim-retiolum.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/krebs/3modules/exim-retiolum.nix b/krebs/3modules/exim-retiolum.nix
index 118a8b2d5..a16661c9f 100644
--- a/krebs/3modules/exim-retiolum.nix
+++ b/krebs/3modules/exim-retiolum.nix
@@ -10,6 +10,11 @@ with import <stockholm/lib>;
(s: substring 1 (stringLength s - 2) s)
(toJSON value);
+ to-lsearch = concatMapStrings ({ from, to, ... }: "${from}: ${to}\n");
+ lsearch = mapAttrs (name: set: toFile name (to-lsearch set)) ({
+ inherit (cfg) system-aliases;
+ });
+
in {
options.krebs.exim-retiolum = {
enable = mkEnableOption "krebs.exim-retiolum";
@@ -59,6 +64,19 @@ in {
};
};
};
+ system-aliases = mkOption {
+ type = types.listOf (types.submodule ({
+ options = {
+ from = mkOption {
+ type = types.str; # TODO e-mail address
+ };
+ to = mkOption {
+ type = types.str; # TODO e-mail address / TODO listOf
+ };
+ };
+ }));
+ default = [];
+ };
};
imports = [
{
@@ -145,6 +163,11 @@ in {
begin routers
+ system_aliases:
+ debug_print = "R: system_aliases for $local_part@$domain"
+ driver = redirect
+ data = ''${lookup{$local_part}lsearch{${lsearch.system-aliases}}}
+
local:
driver = accept
domains = +local_domains