nixos/roon-server: fix openFirewall

This commit is contained in:
Bernardo Meurer 2021-08-31 01:20:07 -07:00
parent df3f3ccc6d
commit edddb705e8
No known key found for this signature in database
GPG key ID: F4C0D53B8D14C246

View file

@ -14,9 +14,6 @@ in {
default = false; default = false;
description = '' description = ''
Open ports in the firewall for the server. Open ports in the firewall for the server.
UDP: 9003
TCP: 9100 - 9200
''; '';
}; };
user = mkOption { user = mkOption {
@ -54,10 +51,15 @@ in {
}; };
networking.firewall = mkIf cfg.openFirewall { networking.firewall = mkIf cfg.openFirewall {
allowedTCPPortRanges = [ allowedTCPPortRanges = [{ from = 9100; to = 9200; }];
{ from = 9100; to = 9200; }
];
allowedUDPPorts = [ 9003 ]; allowedUDPPorts = [ 9003 ];
extraCommands = ''
iptables -A INPUT -s 224.0.0.0/4 -j ACCEPT
iptables -A INPUT -d 224.0.0.0/4 -j ACCEPT
iptables -A INPUT -s 240.0.0.0/5 -j ACCEPT
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -A INPUT -m pkttype --pkt-type broadcast -j ACCEPT
'';
}; };