summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorGabriel Ebner <gebner@gebner.org>2015-09-26 09:40:44 +0200
committerGabriel Ebner <gebner@gebner.org>2015-10-02 13:01:50 +0200
commit0dfddc5a542f4da76faac77f517ca90f6bf66094 (patch)
tree81bfbe64ba6b1a5629f0cf1df8aad590aec8172d /nixos
parentdb18b6e828c28eb191559d98acfd937930958895 (diff)
downloadnixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.tar
nixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.tar.gz
nixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.tar.bz2
nixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.tar.lz
nixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.tar.xz
nixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.tar.zst
nixpkgs-0dfddc5a542f4da76faac77f517ca90f6bf66094.zip
opensmtpd: support filters.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/mail/opensmtpd.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/nixos/modules/services/mail/opensmtpd.nix b/nixos/modules/services/mail/opensmtpd.nix
index a3e50b42292..a1cfd84365a 100644
--- a/nixos/modules/services/mail/opensmtpd.nix
+++ b/nixos/modules/services/mail/opensmtpd.nix
@@ -46,6 +46,17 @@ in {
           is left empty, the OpenSMTPD server will not start.
         '';
       };
+
+      procPackages = mkOption {
+        type = types.listOf types.path;
+        default = [];
+        description = ''
+          Packages to search for filters, tables, queues, and schedulers.
+
+          Add OpenSMTPD-extras here if you want to use the filters, etc. from
+          that package.
+        '';
+      };
     };
 
   };
@@ -72,12 +83,19 @@ in {
       };
     };
 
-    systemd.services.opensmtpd = {
+    systemd.services.opensmtpd = let
+      procEnv = pkgs.buildEnv {
+        name = "opensmtpd-procs";
+        paths = [ opensmtpd ] ++ cfg.procPackages;
+        pathsToLink = [ "/libexec/opensmtpd" ];
+      };
+    in {
       wantedBy = [ "multi-user.target" ];
       wants = [ "network.target" ];
       after = [ "network.target" ];
       preStart = "mkdir -p /var/spool";
       serviceConfig.ExecStart = "${opensmtpd}/sbin/smtpd -d -f ${conf} ${args}";
+      environment.OPENSMTPD_PROC_PATH = "${procEnv}/libexec/opensmtpd";
     };
 
     environment.systemPackages = [ (pkgs.runCommand "opensmtpd-sendmail" {} ''