summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/torrent/deluge.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-06-07 15:46:12 +0200
committerlassulus <lassulus@lassul.us>2022-06-07 15:46:12 +0200
commitb3786c3a74fce6a742649c37ab2ad1255f5864bf (patch)
treea5453da91d868781b2339722a4e7bf588993ac09 /makefu/2configs/torrent/deluge.nix
parente6f67aa910f78ecf75f3a47a0794497148c60c2b (diff)
parent53855cd2d0dadb159215c5ed12e6d0be02dca98b (diff)
Merge remote-tracking branch 'gum/22.05'
Diffstat (limited to 'makefu/2configs/torrent/deluge.nix')
-rw-r--r--makefu/2configs/torrent/deluge.nix42
1 files changed, 42 insertions, 0 deletions
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 <torrent-secrets> + "/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" ];
+}