dotfiles.nix/nixos/viridian/containers/qbittorrent.nix

50 lines
1 KiB
Nix
Raw Normal View History

2024-01-23 09:45:42 +08:00
{ ... }:
2024-06-16 23:08:52 +08:00
let
port = "8487";
in
2024-01-23 09:45:42 +08:00
{
virtualisation.oci-containers.containers = {
# # Open-source software alternative to µTorrent
qbittorrent = {
autoStart = true;
2024-06-16 23:08:52 +08:00
image = "ghcr.io/hotio/qbittorrent:release-4.6.5";
2024-01-23 09:45:42 +08:00
ports = [
2024-07-08 22:09:49 +08:00
"${port}:8080/tcp" # WebUI
"32372:32372/tcp" # Transport protocol
2024-01-23 09:45:42 +08:00
];
volumes = [
# Seedbox
"/srv/multimedia/torrents:/data/torrents:rw"
"/srv/containers/qbittorrent:/config:rw"
];
2024-06-16 23:08:52 +08:00
environment = {
PUID = "1000";
PGID = "100";
};
2024-01-23 09:45:42 +08:00
extraOptions = [
"--network=media-stack"
];
};
};
services.traefik.dynamicConfigOptions.http.routers = {
qbittorrent = {
2024-07-08 22:09:49 +08:00
rule = "Host(`qbittorrent.kanto.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
2024-07-08 22:08:39 +08:00
"internal"
];
service = "qbittorrent";
};
};
services.traefik.dynamicConfigOptions.http.services = {
qbittorrent.loadBalancer.servers = [
2024-06-16 23:08:52 +08:00
{ url = "http://127.0.0.1:${port}"; }
];
};
2024-01-23 09:45:42 +08:00
}