about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-03-11 16:29:06 +0100
committerlethalman <lucabru@src.gnome.org>2015-03-11 16:29:06 +0100
commitfe79bf34a5f982b7cd85734a2866215b73dd1841 (patch)
tree27d1c6ecec84187ea3bbda02926020e4b5decdc9 /nixos
parentb2000f05d97964bfed2b29c95a7b58b5310fddf0 (diff)
parentffb4797dd303589d48bae466ec4b735438f2244e (diff)
Merge pull request #6512 from bjornfor/nixos-haproxy-cleanup
nixos/haproxy: remove broken default 'config'
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/haproxy.nix43
1 files changed, 7 insertions, 36 deletions
diff --git a/nixos/modules/services/networking/haproxy.nix b/nixos/modules/services/networking/haproxy.nix
index 887ea79c34b17..09e48ec4bff07 100644
--- a/nixos/modules/services/networking/haproxy.nix
+++ b/nixos/modules/services/networking/haproxy.nix
@@ -18,42 +18,8 @@ with lib;
       };
 
       config = mkOption {
-        type = types.lines;
-        default =
-          ''
-          global
-            log 127.0.0.1 local6
-            maxconn  24000
-            daemon
-            nbproc 1
-
-          defaults
-            mode http
-            option httpclose
-
-            # Remove requests from the queue if people press stop button
-            option abortonclose
-
-            # Try to connect this many times on failure
-            retries 3
-
-            # If a client is bound to a particular backend but it goes down,
-            # send them to a different one
-            option redispatch
-
-            monitor-uri /haproxy-ping
-
-            timeout connect 7s
-            timeout queue   300s
-            timeout client  300s
-            timeout server  300s
-
-            # Enable status page at this URL, on the port HAProxy is bound to
-            stats enable
-            stats uri /haproxy-status
-            stats refresh 5s
-            stats realm Haproxy statistics
-          '';
+        type = types.nullOr types.lines;
+        default = null;
         description = ''
           Contents of the HAProxy configuration file,
           <filename>haproxy.conf</filename>.
@@ -66,6 +32,11 @@ with lib;
 
   config = mkIf cfg.enable {
 
+    assertions = [{
+      assertion = cfg.config != null;
+      message = "You must provide services.haproxy.config.";
+    }];
+
     systemd.services.haproxy = {
       description = "HAProxy";
       after = [ "network.target" ];