1 { pkgs, lib, config, ... }:
3 inherit (builtins) hasAttr readFile;
4 inherit (pkgs.lib) unlinesAttrs;
5 inherit (config.users) users;
6 inherit (config.services) shorewall shorewall6;
12 DNS(ACCEPT) $FW net {user=${users.unbound.name}}
13 DNS(ACCEPT) $FW net:217.70.177.40 # for knot to notify ns6.gandi.net
14 DNS(ACCEPT) $FW net:78.192.65.63 # for knot to notify ns0.muarf.org
16 HKP(ACCEPT) $FW net {user=${users.julm.name}}
19 IRCS(ACCEPT) $FW net {user=${users.julm.name}}
20 NTP(ACCEPT) $FW net {user=${users.systemd-timesync.name}}
38 SSH(ACCEPT) net $FW {rate=s:1/min:10}
56 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
57 # PORT(S) PORT(S) LIMIT GROUP
62 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
63 # PORT(S) PORT(S) LIMIT GROUP
68 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
69 # PORT(S) PORT(S) LIMIT GROUP
70 PARAM - - udp 60000-61000
75 services.shorewall = {
79 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
87 # DOC: shorewall-zones(5)
94 # DOC: shorewall-interfaces(5)
96 net enp1s0 arp_filter,nosmurfs,routefilter=1,tcpflags
97 lan enp2s0 arp_filter,nosmurfs,routefilter=1,tcpflags
98 unused enp3s0 arp_filter,nosmurfs,routefilter=1,tcpflags
101 # DOC: shorewall-policy(5)
106 # WARNING: the following policy must be last
110 # DOC: shorewall-rules(5)
124 services.shorewall6 = {
126 configs = macros // {
127 "shorewall6.conf" = ''
128 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
136 # DOC: shorewall-zones(5)
143 # DOC: shorewall-interfaces(5)
145 net enp1s0 nosmurfs,tcpflags
146 lan enp2s0 nosmurfs,tcpflags
147 unused enp3s0 nosmurfs,tcpflags
150 # DOC: shorewall-policy(5)
155 # WARNING: the following policy must be last
159 # DOC: shorewall-rules(5)