1 { pkgs, lib, config, ... }:
3 inherit (builtins) hasAttr readFile;
4 inherit (pkgs.lib) unlinesAttrs;
5 inherit (config) users;
6 inherit (config.services) shorewall shorewall6;
12 DNS(ACCEPT) $FW net {user=${users.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.users.julm.name}}
19 IRCS(ACCEPT) $FW net {user=${users.users.julm.name}}
37 SSH(ACCEPT) net $FW {rate=s:1/min:10}
55 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
56 # PORT(S) PORT(S) LIMIT GROUP
61 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
62 # PORT(S) PORT(S) LIMIT GROUP
67 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
68 # PORT(S) PORT(S) LIMIT GROUP
69 PARAM - - udp 60000-61000
74 services.shorewall = {
78 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
86 # DOC: shorewall-zones(5)
93 # DOC: shorewall-interfaces(5)
95 net enp1s0 arp_filter,nosmurfs,routefilter=1,tcpflags
96 lan enp2s0 arp_filter,nosmurfs,routefilter=1,tcpflags
97 unused enp3s0 arp_filter,nosmurfs,routefilter=1,tcpflags
100 # DOC: shorewall-policy(5)
105 # WARNING: the following policy must be last
109 # DOC: shorewall-rules(5)
123 services.shorewall6 = {
125 configs = macros // {
126 "shorewall6.conf" = ''
127 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
135 # DOC: shorewall-zones(5)
142 # DOC: shorewall-interfaces(5)
144 net enp1s0 nosmurfs,tcpflags
145 lan enp2s0 nosmurfs,tcpflags
146 unused enp3s0 nosmurfs,tcpflags
149 # DOC: shorewall-policy(5)
154 # WARNING: the following policy must be last
158 # DOC: shorewall-rules(5)