From 6087a17922c6b0b061b50cd2fa48de5597295f4a Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 6 Jun 2022 21:30:20 +0200 Subject: ma torrent/deluge: init --- makefu/2configs/torrent/deluge.nix | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 makefu/2configs/torrent/deluge.nix diff --git a/makefu/2configs/torrent/deluge.nix b/makefu/2configs/torrent/deluge.nix new file mode 100644 index 000000000..af965fbe9 --- /dev/null +++ b/makefu/2configs/torrent/deluge.nix @@ -0,0 +1,42 @@ +{ config, pkgs, ... }: +let + base = config.makefu.dl-dir; + daemon-port = 58846; + peer-port = 51412; + web-port = 8112; + secfile = toString + "/deluge-auth"; + authfile = config.services.deluge.dataDir + "/myauth"; +in { + services.deluge = { + enable = true; + package = pkgs.deluge-2_x; + openFilesLimit = 65355; + declarative = true; + config = { + download_location = base + "/finished"; + allow_remote = true; + inherit daemon-port; + listen_ports = [ peer-port ]; + copy_torrent_file = true; + torrentfiles_location = base + "/torrents"; + max_active_seeding = 50; + max_connections_global = 1000; + max_half_open_connections = 200; + enabled_plugins = [ "AutoAdd" ]; + }; + openFirewall = true; + group = "download"; + authFile = authfile; + web = { + enable = true; + port = web-port; + }; + }; + + #systemd.services.deluged.serviceConfig.ExecStartPre = pkgs.writeDash "install-auth" '' + # install -odeluge "$secfile" "$authfile" + #''; + services.nginx.enable = true; + services.nginx.virtualHosts."torrent.${config.krebs.build.host.name}.r".locations."/" = { proxyPass = "http://localhost:${toString web-port}/"; }; + state = [ "/var/lib/deluge/.config/deluge" ]; +} -- cgit v1.2.3