expose NFS on local network as well

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-12-29 14:44:06 -06:00
parent d4f62bef18
commit 57b53fa3fd
3 changed files with 49 additions and 16 deletions

View file

@ -1,13 +1,46 @@
{ pkgs, ... }:
{
services.nfs.server = {
enable = true;
exports = ''
/data 100.64.0.0/10(rw,sync,no_subtree_check,fsid=0,crossmnt)
'';
};
pkgs,
config,
lib,
...
}:
lib.mkMerge [
({
services.nfs.server = {
enable = true;
exports = ''
/data 100.64.0.0/10(rw,sync,no_subtree_check,fsid=0,crossmnt)
/data 10.12.14.0/10(rw,sync,no_subtree_check,fsid=0,crossmnt)
'';
};
environment.systemPackages = [
pkgs.nfs-utils
];
}
environment.systemPackages = [
pkgs.nfs-utils
];
})
# Open ports and expose so local network works
(lib.mkIf config.networking.firewall.enable {
services.rpcbind.enable = true;
services.nfs.server.lockdPort = 32803;
services.nfs.server.mountdPort = 892;
services.nfs.server.statdPort = 662;
networking.firewall = {
allowedTCPPorts = [
2049
111
892
32803
662
];
allowedUDPPorts = [
2049
111
892
32803
662
];
};
})
]