From e1c68fec4e7dd0c0f07cf76019b939d7fb46d416 Mon Sep 17 00:00:00 2001 From: jimjam4real Date: Sun, 22 Sep 2024 18:01:25 -0400 Subject: [PATCH] idk i did something --- configuration.nix | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 695dfd5..62baf75 100644 --- a/configuration.nix +++ b/configuration.nix @@ -262,13 +262,42 @@ in 80 443 # Nginx 1234 # Something 25565 # minecraft port - 2049 ]; allowedUDPPorts = [ 4455 24454 # minecraft vc mod ]; + # Add extra input rules using nftables + extraInputRules = '' + ip saddr 10.0.0.240 tcp dport 2049 accept comment "Accept NFS" + ''; }; + nftables = { + enable = true; + tables = { + forwarding = { + family = "ip"; + content = '' + chain PREROUTING { + type nat hook prerouting priority dstnat; policy accept; + tcp dport { 9943, 9944 } dnat to 10.0.0.97 comment "ALVR" + } + chain POSTROUTING { + type nat hook postrouting priority 100; policy accept; + oifname "enp2s0" masquerade + } + ''; + }; + }; + }; + }; + + # NFS server + services.nfs.server = { + enable = true; + exports = '' + /export/freecornNFS 10.0.0.0/24(rw,no_subtree_check) + ''; }; # Copy and link the NixOS configuration file to (/run/current-system/configuration.nix).