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}}
39 SSH(ACCEPT) net $FW {rate=s:1/min:10}
57 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
58 # PORT(S) PORT(S) LIMIT GROUP
63 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
64 # PORT(S) PORT(S) LIMIT GROUP
69 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
70 # PORT(S) PORT(S) LIMIT GROUP
71 PARAM - - udp 60000-61000
76 services.shorewall = {
80 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
88 # DOC: shorewall-zones(5)
95 # DOC: shorewall-interfaces(5)
97 net enp1s0 arp_filter,nosmurfs,routefilter=1,tcpflags
98 lan enp2s0 arp_filter,nosmurfs,routefilter=1,tcpflags
99 unused enp3s0 arp_filter,nosmurfs,routefilter=1,tcpflags
102 # DOC: shorewall-policy(5)
107 # WARNING: the following policy must be last
111 # DOC: shorewall-rules(5)
125 services.shorewall6 = {
127 configs = macros // {
128 "shorewall6.conf" = ''
129 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
137 # DOC: shorewall-zones(5)
144 # DOC: shorewall-interfaces(5)
146 net enp1s0 nosmurfs,tcpflags
147 lan enp2s0 nosmurfs,tcpflags
148 unused enp3s0 nosmurfs,tcpflags
151 # DOC: shorewall-policy(5)
156 # WARNING: the following policy must be last
160 # DOC: shorewall-rules(5)