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}}
38 SSH(ACCEPT) net $FW {rate=s:1/min:10}
44 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
45 # PORT(S) PORT(S) LIMIT GROUP
50 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
51 # PORT(S) PORT(S) LIMIT GROUP
56 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
57 # PORT(S) PORT(S) LIMIT GROUP
58 PARAM - - udp 60000-61000
63 services.shorewall = {
67 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
75 # DOC: shorewall-zones(5)
81 # DOC: shorewall-interfaces(5)
83 net enp5s0 arp_filter,nosmurfs,routefilter=1,tcpflags
84 wet wlp4s0 arp_filter,nosmurfs,routefilter=1,tcpflags
87 # DOC: shorewall-policy(5)
91 # WARNING: the following policy must be last
95 # DOC: shorewall-rules(5)
106 services.shorewall6 = {
108 configs = macros // {
109 "shorewall6.conf" = ''
110 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
118 # DOC: shorewall-zones(5)
124 # DOC: shorewall-interfaces(5)
126 net enp5s0 nosmurfs,tcpflags
127 wet wlp4s0 nosmurfs,tcpflags
130 # DOC: shorewall-policy(5)
134 # WARNING: the following policy must be last
138 # DOC: shorewall-rules(5)