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}}
14 HKP(ACCEPT) $FW net {user=${users.users.julm.name}}
17 IRCS(ACCEPT) $FW net {user=${users.users.julm.name}}
35 SSH(ACCEPT) net $FW {rate=s:1/min:10}
41 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
42 # PORT(S) PORT(S) LIMIT GROUP
47 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
48 # PORT(S) PORT(S) LIMIT GROUP
53 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
54 # PORT(S) PORT(S) LIMIT GROUP
55 PARAM - - udp 60000-61000
60 services.shorewall = {
64 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
72 # DOC: shorewall-zones(5)
78 # DOC: shorewall-interfaces(5)
80 net enp5s0 arp_filter,nosmurfs,routefilter=1,tcpflags
81 wet wlp4s0 arp_filter,nosmurfs,routefilter=1,tcpflags
84 # DOC: shorewall-policy(5)
88 # WARNING: the following policy must be last
92 # DOC: shorewall-rules(5)
103 services.shorewall6 = {
105 configs = macros // {
106 "shorewall6.conf" = ''
107 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
115 # DOC: shorewall-zones(5)
121 # DOC: shorewall-interfaces(5)
123 net enp5s0 nosmurfs,tcpflags
124 wet wlp4s0 nosmurfs,tcpflags
127 # DOC: shorewall-policy(5)
131 # WARNING: the following policy must be last
135 # DOC: shorewall-rules(5)