Compare commits
No commits in common. "a826c532e558fbb7c19834fb56a39933e62e4b95" and "675b8c7b85f4c55f0342ede5740d0fc6d9d5f09d" have entirely different histories.
a826c532e5
...
675b8c7b85
2 changed files with 19 additions and 29 deletions
|
|
@ -2,12 +2,29 @@
|
||||||
services = {
|
services = {
|
||||||
nfs.server = {
|
nfs.server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exports = "/srv/nfs *.sable-pancake.ts.net(ro,fsid=root)";
|
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
|
# NFSv3 uses random ports, so you need to make them static to be able to pass though the firewall
|
||||||
statdPort = 4000;
|
statdPort = 4000;
|
||||||
lockdPort = 4001;
|
lockdPort = 4001;
|
||||||
mountdPort = 4002;
|
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 = {
|
networking.firewall = {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
{config, ...}: let
|
{config, ...}: {
|
||||||
transmissionUid = toString config.users.users.transmission.uid;
|
|
||||||
transmissionGid = toString config.users.groups.transmission.gid;
|
|
||||||
mountPoint = config.fileSystems."nfs_transmission".mountPoint;
|
|
||||||
in {
|
|
||||||
services.transmission = {
|
services.transmission = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
|
|
@ -14,29 +10,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allow my devices to access the downloads folder though NFS
|
|
||||||
fileSystems."nfs_transmission" = {
|
|
||||||
device = config.services.transmission.settings.download-dir;
|
|
||||||
mountPoint = "/srv/nfs/transmission";
|
|
||||||
options = ["bind"];
|
|
||||||
};
|
|
||||||
services.nfs.server.exports = "${mountPoint} *.sable-pancake.ts.net(ro,all_squash,anonuid=${transmissionUid},anongid=${transmissionGid})";
|
|
||||||
|
|
||||||
services.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=${mountPoint}</txt-record>
|
|
||||||
</service>
|
|
||||||
</service-group>
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Add a cname for transmission
|
# Add a cname for transmission
|
||||||
services.dnsmasq.settings.cname = ["transmission.everest.sable-pancake.ts.net,everest"];
|
services.dnsmasq.settings.cname = ["transmission.everest.sable-pancake.ts.net,everest"];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue