nixos/haproxy: small cleanup
* Add option types * Rewrite option descriptions * /var/run/haproxy.pid => /run/haproxy.pid (canonical location)
This commit is contained in:
parent
fb41f0302e
commit
419a4166a7
1 changed files with 13 additions and 9 deletions
|
@ -9,13 +9,16 @@ with lib;
|
||||||
services.haproxy = {
|
services.haproxy = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "
|
description = ''
|
||||||
Enable the HAProxy.
|
Whether to enable HAProxy, the reliable, high performance TCP/HTTP
|
||||||
";
|
load balancer.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
|
type = types.lines;
|
||||||
default =
|
default =
|
||||||
''
|
''
|
||||||
global
|
global
|
||||||
|
@ -51,9 +54,10 @@ with lib;
|
||||||
stats refresh 5s
|
stats refresh 5s
|
||||||
stats realm Haproxy statistics
|
stats realm Haproxy statistics
|
||||||
'';
|
'';
|
||||||
description = "
|
description = ''
|
||||||
Default configuration.
|
Contents of the HAProxy configuration file,
|
||||||
";
|
<filename>haproxy.conf</filename>.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -68,10 +72,10 @@ with lib;
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
PIDFile = "/var/run/haproxy.pid";
|
PIDFile = "/run/haproxy.pid";
|
||||||
ExecStartPre = "${pkgs.haproxy}/sbin/haproxy -c -q -f ${haproxyCfg}";
|
ExecStartPre = "${pkgs.haproxy}/sbin/haproxy -c -q -f ${haproxyCfg}";
|
||||||
ExecStart = "${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /var/run/haproxy.pid";
|
ExecStart = "${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /run/haproxy.pid";
|
||||||
ExecReload = "-${pkgs.bash}/bin/bash -c \"exec ${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /var/run/haproxy.pid -sf $MAINPID\"";
|
ExecReload = "-${pkgs.bash}/bin/bash -c \"exec ${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /run/haproxy.pid -sf $MAINPID\"";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue