From d70eff72498b2887247d2a942fb3b7806b37cdd5 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Tue, 5 Jun 2018 14:03:52 +0200 Subject: [PATCH] Support sockets --- services/haproxy-acme.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/services/haproxy-acme.nix b/services/haproxy-acme.nix index 600bf2ffa..c7dc7d4ca 100644 --- a/services/haproxy-acme.nix +++ b/services/haproxy-acme.nix @@ -25,6 +25,7 @@ in type = with types; attrsOf (submodule { options = { ip = mkOption { type = str; description = "IP address"; }; port = mkOption { type = int; description = "Port number"; }; + socket = mkOption { type = str; description = "Emplacement du socket"; default = ""; }; auth = mkOption { type = bool; description = "Enable authentification"; default = false; }; }; }); example = '' @@ -90,7 +91,16 @@ in '' backend ${name}-backend mode http - server ${name} ${value.ip}:${toString value.port} + ${( + if value.socket == "" then + '' + server ${name} ${value.ip}:${toString value.port} + '' + else + '' + server ${name} ${value.socket} + '' + )} ${(if value.auth then ( "\n acl AuthOK_LOUTRE http_auth(LOUTRE)\n" + " http-request auth realm LOUTRE if !AuthOK_LOUTRE\n"