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
network = import ../data/network.nix;
virtualHostFn = name: service: let
domain = if service.domainOverride == null
then "${name}.${network.local_domain}"
else service.domainOverride;
locationList = if service.reverse_proxy.endpoints == null
then ["/"]
else service.reverse_proxy.endpoints;
domain = if service ? domainOverride
then service.domainOverride
else "${name}.${network.local_domain}";
locationList = if service.reverse_proxy ? endpoints
then service.reverse_proxy.endpoints
else ["/"];
locationsData = builtins.listToAttrs (map (endpointName: {
name = endpointName;
value = {
proxyPass = "http://127.0.0.1:${builtins.toString service.reverse_proxy.port}/";
proxyWebsockets = true;
};
}));
serverAlias = lib.optionalAttrs (service.reverse_proxy.aliases != null) {
}) locationList);
serverAlias = lib.optionalAttrs (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
else {};
in