style(nix): apply style fixes
This commit was merged in pull request #53.
This commit is contained in:
@@ -7,15 +7,20 @@
|
||||
let
|
||||
cfg = config.modules.services.reverse-proxy;
|
||||
|
||||
mkRegistryPath = registryName: host: entry: "registry.${registryName}.${host}.${entry}";
|
||||
mkRegistryPath =
|
||||
registryName: host: entry:
|
||||
"registry.${registryName}.${host}.${entry}";
|
||||
|
||||
mkBackend = address: port: "http://${address}:${toString port}";
|
||||
|
||||
mkVirtualHost = host: entry: mode:
|
||||
mkVirtualHost =
|
||||
host: entry: mode:
|
||||
let
|
||||
compositeEntry = registry.join host entry;
|
||||
route = compositeEntry.route;
|
||||
address = compositeEntry.address or (throw "no matching entry in registry.address for ${mkRegistryPath "route" host entry}");
|
||||
inherit (compositeEntry) route;
|
||||
address =
|
||||
compositeEntry.address
|
||||
or (throw "no matching entry in registry.address for ${mkRegistryPath "route" host entry}");
|
||||
isHttp = mode == "http";
|
||||
port = if isHttp then route.http.port else route.port;
|
||||
in
|
||||
@@ -63,7 +68,11 @@ let
|
||||
domain: virtualHosts:
|
||||
if lib.length virtualHosts > 1 then
|
||||
[
|
||||
"duplicate route domain ${domain} in ${lib.concatMapStringsSep " and " (virtualHost: mkRegistryPath virtualHost.registryName virtualHost.host virtualHost.entry) virtualHosts}"
|
||||
"duplicate route domain ${domain} in ${
|
||||
lib.concatMapStringsSep " and " (
|
||||
virtualHost: mkRegistryPath virtualHost.registryName virtualHost.host virtualHost.entry
|
||||
) virtualHosts
|
||||
}"
|
||||
]
|
||||
else
|
||||
[ ]
|
||||
@@ -76,13 +85,21 @@ let
|
||||
else
|
||||
lib.listToAttrs generatedVirtualHostList;
|
||||
|
||||
mkUdpStream = host: entry: port:
|
||||
mkUdpStream =
|
||||
host: entry: port:
|
||||
let
|
||||
compositeEntry = registry.join host entry;
|
||||
address = compositeEntry.address or (throw "no matching entry in registry.address for ${mkRegistryPath "route" host entry}");
|
||||
address =
|
||||
compositeEntry.address
|
||||
or (throw "no matching entry in registry.address for ${mkRegistryPath "route" host entry}");
|
||||
in
|
||||
{
|
||||
inherit host entry port address;
|
||||
inherit
|
||||
host
|
||||
entry
|
||||
port
|
||||
address
|
||||
;
|
||||
};
|
||||
|
||||
generatedUdpStreams = lib.concatLists (
|
||||
|
||||
Reference in New Issue
Block a user