dotfiles/system/nixos/qbittorrent.nix

59 lines
1.3 KiB
Nix
Raw Normal View History

2023-05-24 11:02:56 +00:00
{ pkgs, lib, ... }:
2023-05-20 11:15:01 +00:00
{
systemd.tmpfiles.rules = [
"d /var/lib/qbittorrent 0750 media_user media_group"
];
2023-05-24 11:02:56 +00:00
virtualisation.oci-containers.containers.qbittorrent = {
image = "lscr.io/linuxserver/qbittorrent:latest";
ports = [ "192.168.42.2:8071:8071" ];
environment = {
"PUID" = "1001";
"PGID" = "2001";
"TZ" = "Etc/UTC";
"WEBUI_PORT" = "8071";
};
volumes = [
"/var/lib/qbittorrent:/config"
"/mnt/downloads:/mnt/downloads"
"${pkgs.vuetorrent}/share:/usr/local/share/vuetorrent"
];
extraOptions = [
"--network=ns:/var/run/netns/wg"
"--cap-add=CAP_NET_RAW"
"--label=com.centurylinklabs.watchtower.enable=true"
"--label=io.containers.autoupdate=registry"
];
};
systemd.services.podman-qbittorrent =
2023-05-20 11:15:01 +00:00
let
2023-05-24 11:02:56 +00:00
mounts = [
"mnt-downloads.mount"
];
2023-05-20 11:15:01 +00:00
in
{
2023-05-24 11:02:56 +00:00
requires = lib.mkAfter mounts;
2023-05-20 11:15:01 +00:00
bindsTo = [ "wg.service" ];
2023-05-24 11:02:56 +00:00
after = lib.mkForce ([ "wg.service" ] ++ mounts);
2023-05-20 11:15:01 +00:00
};
2023-05-20 22:50:04 +00:00
services.nginx.virtualHosts."qbittorrent.internal.kempkens.network" = {
quic = true;
http3 = true;
onlySSL = true;
useACMEHost = "internal.kempkens.network";
extraConfig = ''
client_max_body_size 32m;
'';
locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://192.168.42.2:8071";
};
};
2023-05-20 11:15:01 +00:00
}