summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorWilhelm Schuster <ws@wilhelm.re>2016-09-26 12:16:53 +0200
committerWilhelm Schuster <ws@wilhelm.re>2016-09-26 12:16:53 +0200
commit54c5154b90aa0712699569c5f443d7a8f7102e9d (patch)
tree76efd07e898899c859d5039155381607c8894c41 /nixos
parentf081a1aaf4ec30f953c8c68ce1be9f687179d4e5 (diff)
downloadnixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.tar
nixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.tar.gz
nixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.tar.bz2
nixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.tar.lz
nixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.tar.xz
nixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.tar.zst
nixlib-54c5154b90aa0712699569c5f443d7a8f7102e9d.zip
nginx module: Add option to configure events block
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix19
1 files changed, 15 insertions, 4 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index 94c442e165b7..443bd8c10000 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -18,9 +18,13 @@ let
 
     ${cfg.config}
 
-    ${optionalString (cfg.httpConfig == "" && cfg.config == "") ''
-    events {}
+    ${optionalString (cfg.eventsConfig != "" || cfg.config == "") ''
+    events {
+      ${cfg.eventsConfig}
+    }
+    ''}
 
+    ${optionalString (cfg.httpConfig == "" && cfg.config == "") ''
     http {
       include ${cfg.package}/conf/mime.types;
       include ${cfg.package}/conf/fastcgi.conf;
@@ -98,7 +102,6 @@ let
     }''}
 
     ${optionalString (cfg.httpConfig != "") ''
-    events {}
     http {
       include ${cfg.package}/conf/mime.types;
       include ${cfg.package}/conf/fastcgi.conf;
@@ -272,12 +275,20 @@ in
         ";
       };
 
+      eventsConfig = mkOption {
+        type = types.lines;
+        default = "";
+        description = ''
+          Configuration lines to be set inside the events block.
+        '';
+      };
+
       appendHttpConfig = mkOption {
         type = types.lines;
         default = "";
         description = "
           Configuration lines to be appended to the generated http block.
-          This is mutually exclusive with using config and httpConfig for 
+          This is mutually exclusive with using config and httpConfig for
           specifying the whole http block verbatim.
         ";
       };