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 ACCEPT $FW net {proto=tcp, dport=8080}
18 IRCS(ACCEPT) $FW net {user=${users.julm.name}}
19 NTP(ACCEPT) $FW net {user=${users.systemd-timesync.name}}
37 SSH(ACCEPT) net $FW {rate=s:1/min:10}
43 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
44 # PORT(S) PORT(S) LIMIT GROUP
49 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
50 # PORT(S) PORT(S) LIMIT GROUP
55 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
56 # PORT(S) PORT(S) LIMIT GROUP
57 PARAM - - udp 60000-61000
62 services.shorewall = {
66 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
74 # DOC: shorewall-zones(5)
80 # DOC: shorewall-interfaces(5)
82 net enp5s0 arp_filter,nosmurfs,routefilter=1,tcpflags
83 wet wlp4s0 arp_filter,nosmurfs,routefilter=1,tcpflags
86 # DOC: shorewall-policy(5)
90 # WARNING: the following policy must be last
94 # DOC: shorewall-rules(5)
105 services.shorewall6 = {
107 configs = macros // {
108 "shorewall6.conf" = ''
109 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
117 # DOC: shorewall-zones(5)
123 # DOC: shorewall-interfaces(5)
125 net enp5s0 nosmurfs,tcpflags
126 wet wlp4s0 nosmurfs,tcpflags
129 # DOC: shorewall-policy(5)
133 # WARNING: the following policy must be last
137 # DOC: shorewall-rules(5)