diff --git a/system/nixos/nginx.nix b/system/nixos/nginx.nix index ba9f103..cdbbdec 100644 --- a/system/nixos/nginx.nix +++ b/system/nixos/nginx.nix @@ -1,8 +1,5 @@ { pkgs, lib, config, ... }: -let - interfaces = lib.mapAttrsToList (name: value: value.matchConfig.Name) config.systemd.network.networks ++ [ "tailscale0" ]; -in { services.nginx = { enable = true; @@ -29,15 +26,19 @@ in ''; }; - networking.firewall.interfaces = builtins.listToAttrs - (builtins.map - (iface: - { - name = iface; - value = { - allowedTCPPorts = [ 80 443 ]; - allowedUDPPorts = [ 443 ]; - }; - }) - (builtins.filter builtins.isString interfaces)); + networking.firewall.interfaces = + let + interfaces = lib.mapAttrsToList (_: value: value.matchConfig.Name ? null) config.systemd.network.networks ++ [ "tailscale0" ]; + in + builtins.listToAttrs + (builtins.map + (iface: + { + name = iface; + value = { + allowedTCPPorts = [ 80 443 ]; + allowedUDPPorts = [ 443 ]; + }; + }) + (builtins.filter builtins.isString interfaces)); }