36 lines
1 KiB
Nix
Executable file
36 lines
1 KiB
Nix
Executable file
{ config, lib, ... }:
|
|
|
|
{
|
|
services = {
|
|
nfs.server = {
|
|
enable = true;
|
|
exports = ''
|
|
${config.services.transmission.settings.download-dir} *.sable-pancake.ts.net(ro,all_squash,anonuid=${toString config.users.users.transmission.uid},anongid=${toString config.users.groups.transmission.gid})
|
|
'';
|
|
# NFSv3 uses random ports, so you need to make them static to be able to pass though the firewall
|
|
statdPort = 4000;
|
|
lockdPort = 4001;
|
|
mountdPort = 4002;
|
|
};
|
|
|
|
avahi.extraServiceFiles = {
|
|
Transmission-downloads-nfs = ''
|
|
<?xml version="1.0" standalone='no'?>
|
|
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
|
|
<service-group>
|
|
<name replace-wildcards="yes">Transmission Downloads on %h (NFS)</name>
|
|
<service>
|
|
<type>_nfs._tcp</type>
|
|
<port>2049</port>
|
|
<txt-record>path=${config.services.transmission.settings.download-dir}</txt-record>
|
|
</service>
|
|
</service-group>
|
|
'';
|
|
};
|
|
};
|
|
|
|
networking.firewall = {
|
|
allowedTCPPorts = [ 111 2049 4000 40001 4002 ];
|
|
allowedUDPPorts = [ 111 2049 4000 40001 4002 ];
|
|
};
|
|
}
|