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}}
14 HKP(ACCEPT) $FW net {user=${users.julm.name}}
17 IRCS(ACCEPT) $FW net {user=${users.julm.name}}
18 NTP(ACCEPT) $FW net {user=${users.systemd-timesync.name}}
36 SSH(ACCEPT) net $FW {rate=s:1/min:10}
42 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
43 # PORT(S) PORT(S) LIMIT GROUP
48 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
49 # PORT(S) PORT(S) LIMIT GROUP
54 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
55 # PORT(S) PORT(S) LIMIT GROUP
56 PARAM - - udp 60000-61000
61 services.shorewall = {
65 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
73 # DOC: shorewall-zones(5)
79 # DOC: shorewall-interfaces(5)
81 net enp5s0 arp_filter,nosmurfs,routefilter=1,tcpflags
82 wet wlp4s0 arp_filter,nosmurfs,routefilter=1,tcpflags
85 # DOC: shorewall-policy(5)
89 # WARNING: the following policy must be last
93 # DOC: shorewall-rules(5)
104 services.shorewall6 = {
106 configs = macros // {
107 "shorewall6.conf" = ''
108 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
116 # DOC: shorewall-zones(5)
122 # DOC: shorewall-interfaces(5)
124 net enp5s0 nosmurfs,tcpflags
125 wet wlp4s0 nosmurfs,tcpflags
128 # DOC: shorewall-policy(5)
132 # WARNING: the following policy must be last
136 # DOC: shorewall-rules(5)