{configVars, ...}: let homeshareDataLocation = configVars.locations.homeshareDataLocation; in { fileSystems."/srv/export/photos" = { device = "${homeshareDataLocation}/photos"; options = [ "bind" ]; }; fileSystems."/srv/export/personal" = { device = "${homeshareDataLocation}/personal"; options = [ "bind" ]; }; fileSystems."/srv/export/media" = { device = "${homeshareDataLocation}/media"; options = [ "bind" ]; }; services.nfs.server = { enable = true; # fixed rpc.statd port; for firewall lockdPort = 4001; mountdPort = 4002; statdPort = 4000; extraNfsdConfig = ''''; exports = '' /srv/export/photos 192.10.99.0/24(rw,sync,no_subtree_check) 10.0.10.0/24(rw,sync,no_subtree_check) /srv/export/media 192.10.99.0/24(rw,sync,no_subtree_check) 10.0.10.0/24(rw,sync,no_subtree_check) /srv/export/personal 192.10.99.0/24(rw,sync,no_subtree_check) 10.0.10.0/24(rw,sync,no_subtree_check) ''; }; # open nfs ports networking.firewall = { enable = true; # for NFSv3; view with `rpcinfo -p` allowedTCPPorts = [ 111 2049 4000 4001 4002 20048 ]; allowedUDPPorts = [ 111 2049 4000 4001 4002 20048 ]; }; }