This commit is contained in:
Lilith 2025-12-04 13:28:25 +01:00
parent a18e244ba5
commit 05a9d96d4e
No known key found for this signature in database
GPG key ID: 272C807BD91F8446
26 changed files with 861 additions and 182 deletions

33
server/nfs-server.nix Normal file
View file

@ -0,0 +1,33 @@
{ lib, config, ... }:
{
options.server.nfs.enable = lib.mkEnableOption "Enable NFS shares";
config = lib.mkIf config.server.nfs.enable {
services.nfs.server = {
enable = true;
exports = ''
/export 192.168.178.111/24(rw,fsid=0,no_subtree_check)
/export/share 192.168.178.111/24(rw,nohide,insecure,no_subtree_check)
/export/torrent 192.168.178.111/24(rw,nohide,insecure,no_subtree_check)
'';
};
services.nfs.settings.main = {
UDP = false;
vers2 = false;
vers3 = false;
};
fileSystems."/export/share" = {
device = "/data/share";
options = [ "bind" ];
};
fileSystems."/export/torrent" = {
device = "/data/torrent";
options = [ "bind" ];
};
networking.firewall.allowedTCPPorts = [ 2049 ];
};
}