fix: fix attr check

This commit is contained in:
Katharina Heidenreich 2026-03-14 13:05:47 +01:00
parent bd8ec1736f
commit 290524071a

View file

@ -2,23 +2,23 @@
let let
network = import ../data/network.nix; network = import ../data/network.nix;
virtualHostFn = name: service: let virtualHostFn = name: service: let
domain = if service.domainOverride == null domain = if service ? domainOverride
then "${name}.${network.local_domain}" then service.domainOverride
else service.domainOverride; else "${name}.${network.local_domain}";
locationList = if service.reverse_proxy.endpoints == null locationList = if service.reverse_proxy ? endpoints
then ["/"] then service.reverse_proxy.endpoints
else service.reverse_proxy.endpoints; else ["/"];
locationsData = builtins.listToAttrs (map (endpointName: { locationsData = builtins.listToAttrs (map (endpointName: {
name = endpointName; name = endpointName;
value = { value = {
proxyPass = "http://127.0.0.1:${builtins.toString service.reverse_proxy.port}/"; proxyPass = "http://127.0.0.1:${builtins.toString service.reverse_proxy.port}/";
proxyWebsockets = true; proxyWebsockets = true;
}; };
})); }) locationList);
serverAlias = lib.optionalAttrs (service.reverse_proxy.aliases != null) { serverAlias = lib.optionalAttrs (service.reverse_proxy ? aliases) {
serverAliases = map (alias: "${alias}.${domain}") service.reverse_proxy.aliases; serverAliases = map (alias: "${alias}.${domain}") service.reverse_proxy.aliases;
}; };
myExtraConfig = if service.reverse_proxy.extraConfig != null myExtraConfig = if service.reverse_proxy ? extraConfig
then service.reverse_proxy.extraConfig then service.reverse_proxy.extraConfig
else {}; else {};
in in