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

57 lines
1.4 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"
"--sysctls=net.ipv4.conf.all.src_valid_mark=1,net.ipv6.conf.all.disable_ipv6=0"
];
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" ];
2024-04-28 01:14:19 +02:00
environment = {
2024-05-31 01:28:43 +02:00
VPN_TYPE = "wireguard";
TZ = "Europe/Amsterdam";
2024-05-30 05:07:25 +02:00
PGID = "100";
PUID = "1000";
2024-04-28 01:14:19 +02:00
};
};
2024-05-30 04:42:05 +02:00
# {{{ open-vpn
virtualisation.oci-containers.containers.openvpn-client = {
image = "ghcr.io/wfg/openvpn-client";
2024-04-28 01:14:19 +02:00
extraOptions = [
"--cap-add=net_admin"
];
2024-05-30 04:42:05 +02:00
volumes = [ "${vpnConfigDir}:/data/vpn" ];
2024-04-28 01:14:19 +02:00
environment = {
2024-05-31 01:28:43 +02:00
# KILL_SWITCH = "on"; # Turns off internet access if the VPN connection drops
2024-04-28 01:14:19 +02:00
};
};
# }}}
}