mediaserver: add nginx
This commit is contained in:
parent
c516c9c3c9
commit
4841a89c3d
1 changed files with 15 additions and 14 deletions
|
@ -1,8 +1,5 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
interfaces = lib.mapAttrsToList (name: value: value.matchConfig.Name) config.systemd.network.networks ++ [ "tailscale0" ];
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -29,15 +26,19 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.interfaces = builtins.listToAttrs
|
networking.firewall.interfaces =
|
||||||
(builtins.map
|
let
|
||||||
(iface:
|
interfaces = lib.mapAttrsToList (_: value: value.matchConfig.Name ? null) config.systemd.network.networks ++ [ "tailscale0" ];
|
||||||
{
|
in
|
||||||
name = iface;
|
builtins.listToAttrs
|
||||||
value = {
|
(builtins.map
|
||||||
allowedTCPPorts = [ 80 443 ];
|
(iface:
|
||||||
allowedUDPPorts = [ 443 ];
|
{
|
||||||
};
|
name = iface;
|
||||||
})
|
value = {
|
||||||
(builtins.filter builtins.isString interfaces));
|
allowedTCPPorts = [ 80 443 ];
|
||||||
|
allowedUDPPorts = [ 443 ];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(builtins.filter builtins.isString interfaces));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue