1
Fork 0
satellite/hosts/nixos/lapetus/services/qbittorrent.nix

44 lines
1.1 KiB
Nix
Raw Normal View History

2024-04-28 01:14:19 +02:00
{ config, pkgs, ... }:
let
port = 8417;
2024-05-29 03:18:16 +02:00
dataDir = "/persist/data/media";
2024-04-28 01:14:19 +02:00
configDir = "/persist/state/var/lib/qbittorrent";
in
{
imports = [ ../../common/optional/services/nginx.nix ];
services.nginx.virtualHosts."qbit.moonythm.dev" =
2024-05-30 04:59:09 +02:00
config.satellite.proxy port { proxyWebsockets = true; };
2024-04-28 01:14:19 +02:00
2024-05-29 03:18:16 +02:00
systemd.tmpfiles.rules = [
2024-05-31 01:28:43 +02:00
"d ${dataDir} 755 ${config.users.users.pilot.name} users"
"d ${configDir} 755 ${config.users.users.pilot.name} users"
2024-05-29 03:18:16 +02:00
];
2024-04-28 01:25:19 +02:00
virtualisation.oci-containers.containers.qbittorrent = {
2024-05-31 01:28:43 +02:00
image = "trigus42/qbittorrentvpn";
extraOptions = [
"--cap-add=net_admin"
2024-05-31 01:41:34 +02:00
"--sysctl=net.ipv4.conf.all.src_valid_mark=1"
"--sysctl=net.ipv6.conf.all.disable_ipv6=0"
"--device=/dev/net/tun"
2024-05-31 01:28:43 +02:00
];
volumes = [
"${dataDir}:/downloads"
"${configDir}:/config/qBittorrent"
"/persist/state/var/lib/mullvad/openvpn:/config/openvpn"
2024-05-31 01:59:56 +02:00
"/persist/state/var/lib/mullvad/wireguard:/config/wireguard"
2024-05-31 01:28:43 +02:00
];
ports = [ "${toString port}:8080" ];
2024-04-28 01:14:19 +02:00
environment = {
VPN_TYPE = "wireguard";
2024-05-31 01:28:43 +02:00
TZ = "Europe/Amsterdam";
2024-05-30 05:07:25 +02:00
PGID = "100";
PUID = "1000";
2024-04-28 01:14:19 +02:00
};
};
}