1
Fork 0

Fix qbit install

This commit is contained in:
prescientmoon 2024-05-31 01:28:43 +02:00
parent 27cc8518e9
commit 1196ed8fa4
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -1,12 +1,8 @@
# Sources:
# https://github.com/nickkjolsing/dockerMullvadVPN
# https://www.reddit.com/r/HomeServer/comments/xapl93/a_minimal_configuration_stepbystep_guide_to_media/
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
port = 8417; port = 8417;
dataDir = "/persist/data/media"; dataDir = "/persist/data/media";
configDir = "/persist/state/var/lib/qbittorrent"; configDir = "/persist/state/var/lib/qbittorrent";
vpnConfigDir = "/persist/state/var/lib/openvpn";
in in
{ {
imports = [ ../../common/optional/services/nginx.nix ]; imports = [ ../../common/optional/services/nginx.nix ];
@ -15,19 +11,29 @@ in
config.satellite.proxy port { proxyWebsockets = true; }; config.satellite.proxy port { proxyWebsockets = true; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d ${dataDir} 777 ${config.users.users.pilot.name} users" "d ${dataDir} 755 ${config.users.users.pilot.name} users"
"d ${configDir}" "d ${configDir} 755 ${config.users.users.pilot.name} users"
]; ];
virtualisation.oci-containers.containers.qbittorrent = { virtualisation.oci-containers.containers.qbittorrent = {
image = "linuxserver/qbittorrent:latest"; image = "trigus42/qbittorrentvpn";
extraOptions = [ "--network=container:openvpn-client" ]; extraOptions = [
dependsOn = [ "openvpn-client" ]; "--cap-add=net_admin"
volumes = [ "${dataDir}:/downloads" "${configDir}:/config" ]; "--sysctls=net.ipv4.conf.all.src_valid_mark=1,net.ipv6.conf.all.disable_ipv6=0"
ports = [ "${toString port}:${toString port}" ]; ];
volumes = [
"${dataDir}:/downloads"
"${configDir}:/config/qBittorrent"
"/persist/state/var/lib/mullvad/openvpn:/config/openvpn"
"/persist/state/var/lib/mullvad/wireguard:/config/openvpn"
];
ports = [ "${toString port}:8080" ];
environment = { environment = {
WEBUI_PORT = toString port; VPN_TYPE = "wireguard";
TZ = "Europe/Amsterdam";
PGID = "100"; PGID = "100";
PUID = "1000"; PUID = "1000";
}; };
@ -37,15 +43,13 @@ in
virtualisation.oci-containers.containers.openvpn-client = { virtualisation.oci-containers.containers.openvpn-client = {
image = "ghcr.io/wfg/openvpn-client"; image = "ghcr.io/wfg/openvpn-client";
extraOptions = [ extraOptions = [
"--network=bridge"
"--cap-add=net_admin" "--cap-add=net_admin"
"--device=/dev/net/tun"
]; ];
volumes = [ "${vpnConfigDir}:/data/vpn" ]; volumes = [ "${vpnConfigDir}:/data/vpn" ];
environment = { environment = {
KILL_SWITCH = "on"; # Turns off internet access if the VPN connection drops # KILL_SWITCH = "on"; # Turns off internet access if the VPN connection drops
}; };
}; };
# }}} # }}}