summary refs log tree commit diff
path: root/nixos/modules/services/networking/haproxy.nix
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2015-02-21 13:23:48 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2015-02-22 12:29:34 +0100
commit419a4166a794f5178862f43038d797f4fc918994 (patch)
tree5aa6c654ad9455ac6ca6791a6773c798130813ff /nixos/modules/services/networking/haproxy.nix
parentfb41f0302ea4cc3ef3f95ade31341e95baf05d92 (diff)
downloadnixlib-419a4166a794f5178862f43038d797f4fc918994.tar
nixlib-419a4166a794f5178862f43038d797f4fc918994.tar.gz
nixlib-419a4166a794f5178862f43038d797f4fc918994.tar.bz2
nixlib-419a4166a794f5178862f43038d797f4fc918994.tar.lz
nixlib-419a4166a794f5178862f43038d797f4fc918994.tar.xz
nixlib-419a4166a794f5178862f43038d797f4fc918994.tar.zst
nixlib-419a4166a794f5178862f43038d797f4fc918994.zip
nixos/haproxy: small cleanup
* Add option types
* Rewrite option descriptions
* /var/run/haproxy.pid => /run/haproxy.pid (canonical location)
Diffstat (limited to 'nixos/modules/services/networking/haproxy.nix')
-rw-r--r--nixos/modules/services/networking/haproxy.nix22
1 files changed, 13 insertions, 9 deletions
diff --git a/nixos/modules/services/networking/haproxy.nix b/nixos/modules/services/networking/haproxy.nix
index c2e2c2d7a418..887ea79c34b1 100644
--- a/nixos/modules/services/networking/haproxy.nix
+++ b/nixos/modules/services/networking/haproxy.nix
@@ -9,13 +9,16 @@ with lib;
     services.haproxy = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
-        description = "
-          Enable the HAProxy.
-        ";
+        description = ''
+          Whether to enable HAProxy, the reliable, high performance TCP/HTTP
+          load balancer.
+        '';
       };
 
       config = mkOption {
+        type = types.lines;
         default =
           ''
           global
@@ -51,9 +54,10 @@ with lib;
             stats refresh 5s
             stats realm Haproxy statistics
           '';
-        description = "
-          Default configuration.
-        ";
+        description = ''
+          Contents of the HAProxy configuration file,
+          <filename>haproxy.conf</filename>.
+        '';
       };
 
     };
@@ -68,10 +72,10 @@ with lib;
       wantedBy = [ "multi-user.target" ];
       serviceConfig = {
         Type = "forking";
-        PIDFile = "/var/run/haproxy.pid";
+        PIDFile = "/run/haproxy.pid";
         ExecStartPre = "${pkgs.haproxy}/sbin/haproxy -c -q -f ${haproxyCfg}";
-        ExecStart = "${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /var/run/haproxy.pid";
-        ExecReload = "-${pkgs.bash}/bin/bash -c \"exec ${pkgs.haproxy}/sbin/haproxy -D -f ${haproxyCfg} -p /var/run/haproxy.pid -sf $MAINPID\"";
+        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 /run/haproxy.pid -sf $MAINPID\"";
       };
     };