@@ -9,13 +9,16 @@ with lib;
99 services.haproxy = {
1010
1111 enable = mkOption {
12+ type = types.bool;
1213 default = false;
13− description = "
14− Enable the HAProxy.
15− ";
14+ description = ''
15+ Whether to enable HAProxy, the reliable, high performance TCP/HTTP
16+ load balancer.
17+ '';
1618 };
1719
1820 config = mkOption {
21+ type = types.lines;
1922 default =
2023 ''
2124 global
@@ -51,9 +54,10 @@ with lib;
5154 stats refresh 5s
5255 stats realm Haproxy statistics
5356 '';
54− description = "
55− Default configuration.
56− ";
57+ description = ''
58+ Contents of the HAProxy configuration file,
59+ <filename>haproxy.conf</filename>.
60+ '';
5761 };
5862
5963 };
@@ -68,10 +72,10 @@ with lib;
6872 wantedBy = [ "multi-user.target" ];
6973 serviceConfig = {
7074 Type = "forking";
71− PIDFile = "/var/run/haproxy.pid";
75+ PIDFile = "/run/haproxy.pid";
7276 ExecStartPre = "${pkgs.haproxy}/sbin/haproxy -c -q -f ${haproxyCfg}";
73− ExecStart = "${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /var/run/haproxy.pid";
74− ExecReload = "-${pkgs.bash}/bin/bash -c \"exec ${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /var/run/haproxy.pid -sf $MAINPID\"";
77+ ExecStart = "${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /run/haproxy.pid";
78+ ExecReload = "-${pkgs.bash}/bin/bash -c \"exec ${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /run/haproxy.pid -sf $MAINPID\"";
7579 };
7680 };
7781