30 lines
501 B
Nix
30 lines
501 B
Nix
{ cfg, lib }:
|
|
let
|
|
|
|
clientSection =
|
|
clientName:
|
|
''
|
|
[clients.${clientName}]
|
|
'';
|
|
|
|
clientSections = map clientSection cfg.clients;
|
|
|
|
in
|
|
''
|
|
[listen]
|
|
listen_to = "${cfg.bindHost}:${builtins.toString cfg.bindPort}"
|
|
|
|
# Must be kept secret.
|
|
server_key = "${cfg.serverKeyFile}"
|
|
|
|
server_certificate = "${cfg.serverCertFile}"
|
|
ca_certificate = "${cfg.caCertFile}"
|
|
|
|
timeout = ${builtins.toString cfg.idleTimeout}
|
|
|
|
[service]
|
|
root = "${cfg.rootDir}"
|
|
|
|
${lib.strings.concatStrings clientSections}
|
|
''
|