nixos/haproxy: remove broken default 'config'

HAProxy fails to start with the default 'config'. Better disable it and
assert that the user provides a suitable 'config'. (AFAICS, there cannot
really be a default config file for HAProxy.)

+7 -36
+7 -36
nixos/modules/services/networking/haproxy.nix
··· 18 18 }; 19 19 20 20 config = mkOption { 21 - type = types.lines; 22 - default = 23 - '' 24 - global 25 - log 127.0.0.1 local6 26 - maxconn 24000 27 - daemon 28 - nbproc 1 29 - 30 - defaults 31 - mode http 32 - option httpclose 33 - 34 - # Remove requests from the queue if people press stop button 35 - option abortonclose 36 - 37 - # Try to connect this many times on failure 38 - retries 3 39 - 40 - # If a client is bound to a particular backend but it goes down, 41 - # send them to a different one 42 - option redispatch 43 - 44 - monitor-uri /haproxy-ping 45 - 46 - timeout connect 7s 47 - timeout queue 300s 48 - timeout client 300s 49 - timeout server 300s 50 - 51 - # Enable status page at this URL, on the port HAProxy is bound to 52 - stats enable 53 - stats uri /haproxy-status 54 - stats refresh 5s 55 - stats realm Haproxy statistics 56 - ''; 21 + type = types.nullOr types.lines; 22 + default = null; 57 23 description = '' 58 24 Contents of the HAProxy configuration file, 59 25 <filename>haproxy.conf</filename>. ··· 65 31 }; 66 32 67 33 config = mkIf cfg.enable { 34 + 35 + assertions = [{ 36 + assertion = cfg.config != null; 37 + message = "You must provide services.haproxy.config."; 38 + }]; 68 39 69 40 systemd.services.haproxy = { 70 41 description = "HAProxy";