2025-06-01 15:04:11 -04:00
|
|
|
{ config, pkgs, ... }:
|
2024-08-16 12:15:42 -04:00
|
|
|
|
|
|
|
|
let
|
2026-01-07 22:16:01 -05:00
|
|
|
qbitBase = {
|
|
|
|
|
image = "ghcr.io/linuxserver/qbittorrent:latest";
|
2025-06-01 18:35:15 -04:00
|
|
|
pull = "always";
|
2024-08-16 12:15:42 -04:00
|
|
|
environment = {
|
|
|
|
|
PUID = "600";
|
|
|
|
|
PGID = "100";
|
|
|
|
|
TZ = "America/New_York";
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-08-17 21:49:31 -04:00
|
|
|
|
|
|
|
|
vars = import ../vars.nix;
|
2024-11-28 13:15:39 -05:00
|
|
|
#docker_path = vars.primary_docker;
|
2024-08-17 21:49:31 -04:00
|
|
|
torr_path = vars.primary_torr;
|
2026-01-07 22:16:01 -05:00
|
|
|
qbit_path = "${torr_path}/qbit";
|
|
|
|
|
qbitvpn_path = "${torr_path}/qbitvpn";
|
|
|
|
|
qbitperm_path = "${torr_path}/qbitperm";
|
2024-08-16 12:15:42 -04:00
|
|
|
in
|
|
|
|
|
{
|
2025-06-01 15:51:40 -04:00
|
|
|
|
2024-08-16 12:15:42 -04:00
|
|
|
virtualisation.oci-containers.containers = {
|
2026-01-07 22:16:01 -05:00
|
|
|
qbit = qbitBase // {
|
2026-01-07 23:03:17 -05:00
|
|
|
# webui port is 8082, torr port is 29432
|
2026-01-07 22:16:01 -05:00
|
|
|
environment = qbitBase.environment // {
|
|
|
|
|
WEBUI_PORT = "8082";
|
2026-01-07 23:20:51 -05:00
|
|
|
TORRENTING_PORT = "29432";
|
2026-01-07 22:16:01 -05:00
|
|
|
};
|
2024-08-16 12:15:42 -04:00
|
|
|
volumes = [
|
2026-01-07 22:16:01 -05:00
|
|
|
"${qbit_path}/config:/config" # move from docker/qbit to qbit_path
|
2026-01-08 16:28:54 -05:00
|
|
|
"${torr_path}/data/:/data"
|
2024-08-16 12:15:42 -04:00
|
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
|
|
|
];
|
2026-01-08 11:45:15 -05:00
|
|
|
networks = [ "host" ];
|
2024-08-16 12:15:42 -04:00
|
|
|
ports = [
|
2026-01-07 23:18:10 -05:00
|
|
|
"8082:8082"
|
2026-01-07 22:16:01 -05:00
|
|
|
"29432:29432"
|
2026-01-07 23:20:51 -05:00
|
|
|
"29432:29432/udp"
|
2024-08-16 12:15:42 -04:00
|
|
|
];
|
2026-01-08 16:28:54 -05:00
|
|
|
extraOptions = [
|
|
|
|
|
"--dns=9.9.9.9"
|
|
|
|
|
];
|
2024-08-16 12:15:42 -04:00
|
|
|
};
|
2026-01-07 22:16:01 -05:00
|
|
|
qbitVPN = qbitBase // {
|
2026-01-07 23:03:17 -05:00
|
|
|
# webui port is 8081, torr port is 39274
|
2026-01-07 22:16:01 -05:00
|
|
|
networks = [
|
|
|
|
|
"container:gluetun-qbit"
|
|
|
|
|
];
|
2026-01-07 23:20:51 -05:00
|
|
|
environment = qbitBase.environment // {
|
|
|
|
|
WEBUI_PORT = "8081";
|
|
|
|
|
};
|
2026-01-07 22:16:01 -05:00
|
|
|
dependsOn = [ "gluetun-qbit" ];
|
2024-08-16 12:15:42 -04:00
|
|
|
volumes = [
|
2026-01-07 22:16:01 -05:00
|
|
|
"${qbitvpn_path}/config:/config"
|
2026-01-08 16:28:54 -05:00
|
|
|
"${torr_path}/data:/data"
|
2024-08-16 12:15:42 -04:00
|
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
|
|
|
];
|
2026-01-07 22:16:01 -05:00
|
|
|
};
|
|
|
|
|
qbitPerm = qbitBase // {
|
|
|
|
|
# webui port is 8083, torr port is 29434
|
|
|
|
|
networks = [
|
|
|
|
|
"container:gluetun-qbit"
|
|
|
|
|
];
|
2026-01-07 23:20:51 -05:00
|
|
|
environment = qbitBase.environment // {
|
|
|
|
|
WEBUI_PORT = "8083";
|
|
|
|
|
};
|
2026-01-07 22:16:01 -05:00
|
|
|
dependsOn = [ "gluetun-qbit" ];
|
|
|
|
|
volumes = [
|
|
|
|
|
"${qbitperm_path}/config:/config"
|
2026-01-08 16:28:54 -05:00
|
|
|
"${torr_path}/data:/data"
|
2026-01-07 22:16:01 -05:00
|
|
|
"/etc/localtime:/etc/localtime:ro"
|
2024-08-16 12:15:42 -04:00
|
|
|
];
|
|
|
|
|
};
|
2026-01-07 22:16:01 -05:00
|
|
|
gluetun-qbit = {
|
|
|
|
|
image = "qmcgaw/gluetun:v3";
|
|
|
|
|
capabilities = {
|
2026-01-07 22:56:55 -05:00
|
|
|
NET_ADMIN = true;
|
2026-01-07 22:16:01 -05:00
|
|
|
};
|
|
|
|
|
devices = [
|
|
|
|
|
"/dev/net/tun:/dev/net/tun"
|
|
|
|
|
];
|
|
|
|
|
ports = [
|
|
|
|
|
# qbitvpn
|
|
|
|
|
"8081:8081"
|
2026-01-07 23:03:17 -05:00
|
|
|
"39274:39274"
|
2024-08-16 12:15:42 -04:00
|
|
|
|
2026-01-07 22:16:01 -05:00
|
|
|
# qbitperm
|
|
|
|
|
"8083:8083"
|
|
|
|
|
"29433:24933"
|
|
|
|
|
];
|
|
|
|
|
environment = {
|
|
|
|
|
TZ = "America/New_York";
|
|
|
|
|
# SOPS prep
|
|
|
|
|
};
|
|
|
|
|
environmentFiles = [
|
|
|
|
|
config.sops.secrets."docker/gluetun".path
|
2025-06-01 15:22:05 -04:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-11-28 13:15:39 -05:00
|
|
|
|
2026-01-07 22:16:01 -05:00
|
|
|
sops.secrets = {
|
|
|
|
|
"docker/gluetun" = {
|
2025-06-01 15:51:40 -04:00
|
|
|
owner = "docker-service";
|
2026-01-07 22:16:01 -05:00
|
|
|
restartUnits = [ "docker-gluetun-qbit.service" ];
|
2025-06-01 15:51:40 -04:00
|
|
|
};
|
2025-06-01 15:04:11 -04:00
|
|
|
};
|
2024-08-16 12:15:42 -04:00
|
|
|
}
|