use with clause to avoid repetitions
This commit is contained in:
parent
ed0983b633
commit
df45cf258a
1 changed files with 7 additions and 5 deletions
|
@ -18,11 +18,13 @@
|
||||||
, prometheusStatsUri ? null
|
, prometheusStatsUri ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
with lib.strings;
|
||||||
let
|
let
|
||||||
|
|
||||||
stats = if statsEnable then "" else ''
|
stats = if statsEnable then "" else ''
|
||||||
frontend stats
|
frontend stats
|
||||||
bind localhost:${builtins.toString statsPort}
|
bind localhost:${toString statsPort}
|
||||||
mode http
|
mode http
|
||||||
stats enable
|
stats enable
|
||||||
# stats hide-version
|
# stats hide-version
|
||||||
|
@ -33,12 +35,12 @@ let
|
||||||
'');
|
'');
|
||||||
|
|
||||||
indent = spaces: content:
|
indent = spaces: content:
|
||||||
lib.strings.concatMapStrings
|
concatMapStrings
|
||||||
(x: spaces + x + "\n")
|
(x: spaces + x + "\n")
|
||||||
(lib.strings.splitString "\n" content);
|
(splitString "\n" content);
|
||||||
|
|
||||||
frontends_str = lib.strings.concatMapStrings (acl: indent " " acl) frontends;
|
frontends_str = concatMapStrings (acl: indent " " acl) frontends;
|
||||||
backends_str = builtins.concatStringsSep "\n" backends;
|
backends_str = concatStringsSep "\n" backends;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue