{ lib, pkgs, auxiliaryPkgs, ... }: let inherit (pkgs) dockerTools; inherit (auxiliaryPkgs) common; qbittorrent = pkgs.qbittorrent-nox; torrentLocalPort = 2018; torrentDir = "/srv/torrent"; qbittorrentImage = dockerTools.streamLayeredImage { name = "qbittorrent"; tag = qbittorrent.version; fromImage = common.alpine.base; contents = [ qbittorrent ]; }; in { foundation.services.torrent = { image = qbittorrentImage; volumes = [ [ "${torrentDir}/qbittorrent" "/qbittorrent/config" ] [ "${torrentDir}/download" "/qbittorrent/download" ] ]; entrypoint = lib.getExe qbittorrent; cmd = [ "--confirm-legal-notice" "--profile=/qbittorrent/config" "--webui-port=${toString torrentLocalPort}" ]; customNetworkOption = "container:vpn"; }; }