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).