summaryrefslogtreecommitdiff
path: root/nixos/hosts/apocalypse/firewall.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/hosts/apocalypse/firewall.nix')
-rw-r--r--nixos/hosts/apocalypse/firewall.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixos/hosts/apocalypse/firewall.nix b/nixos/hosts/apocalypse/firewall.nix
new file mode 100644
index 0000000..2068d55
--- /dev/null
+++ b/nixos/hosts/apocalypse/firewall.nix
@@ -0,0 +1,47 @@
+{pkgs, config, ...}:
+let
+ baseTCP = [
+
+ ];
+ baseUDP = [
+ 16555 # Wireguard
+ ];
+ baseTCPRanges = [
+ { from = 1714; to = 1764; } # KDE-CONNECT
+ ];
+ baseUDPRanges = [
+ { from = 1714; to = 1764; } # KDE-CONNECT
+ ];
+
+ secureTCP = [
+ 22 80 433 5900
+ ] ++ baseTCP;
+
+ secureUDP = [
+
+ ] ++ baseUDP;
+
+ secureTCPRanges = [
+
+ ] ++ baseTCPRanges ;
+ secureUDPRanges = [
+
+ ] ++ baseUDPRanges;
+in
+{
+ networking.firewall {
+ enable = true;
+ allowedTCPPorts = baseTCP;
+ allowedUDPPorts = baseUDP;
+ allowedUDPPortRanges = baseUDPRanges;
+ allowedTCPPortRanges = baseTCPRanges;
+ interfaces = {
+ "wg0" = {
+ allowedTCPPorts = secureTCP;
+ allowedUDPorts = secureUDP;
+ allowedUDPPortRanges = secureUDPRanges;
+ allowedTCPPortRanges = secureTCPRanges;
+ };
+ };
+}
+