about summary refs log tree commit diff
path: root/nixos/modules/services/mail
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-11-12 10:11:24 -0500
committerAaron Andersen <aaron@fosslib.net>2019-11-12 10:11:24 -0500
commit1759424fc69fa04eb840c6cd8d2041b9e95c1983 (patch)
treeceeaa6dc37300e5825ee99056f09a8cc6f021bf9 /nixos/modules/services/mail
parent27670961f5814c5e0276c44242bfec0ec938d084 (diff)
downloadnixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.tar
nixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.tar.gz
nixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.tar.bz2
nixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.tar.lz
nixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.tar.xz
nixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.tar.zst
nixlib-1759424fc69fa04eb840c6cd8d2041b9e95c1983.zip
nixos/mailcatcher: add http.path option
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r--nixos/modules/services/mail/mailcatcher.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/services/mail/mailcatcher.nix b/nixos/modules/services/mail/mailcatcher.nix
index f5b4508b335c..84f06ed199dc 100644
--- a/nixos/modules/services/mail/mailcatcher.nix
+++ b/nixos/modules/services/mail/mailcatcher.nix
@@ -25,6 +25,13 @@ in
         description = "The port address of the http server.";
       };
 
+      http.path = mkOption {
+        type = with types; nullOr str;
+        default = null;
+        description = "Prefix to all HTTP paths.";
+        example = "/mailcatcher";
+      };
+
       smtp.ip = mkOption {
         type = types.str;
         default = "127.0.0.1";
@@ -53,7 +60,7 @@ in
       serviceConfig = {
         DynamicUser = true;
         Restart = "always";
-        ExecStart = "${pkgs.mailcatcher}/bin/mailcatcher --foreground --no-quit --http-ip ${cfg.http.ip} --http-port ${toString cfg.http.port} --smtp-ip ${cfg.smtp.ip} --smtp-port ${toString cfg.smtp.port}";
+        ExecStart = "${pkgs.mailcatcher}/bin/mailcatcher --foreground --no-quit --http-ip ${cfg.http.ip} --http-port ${toString cfg.http.port} --smtp-ip ${cfg.smtp.ip} --smtp-port ${toString cfg.smtp.port}" + optionalString (cfg.http.path != null) " --http-path ${cfg.http.path}";
         AmbientCapabilities = optionalString (cfg.http.port < 1024 || cfg.smtp.port < 1024) "cap_net_bind_service";
       };
     };