This commit is contained in:
2025-07-20 19:14:49 +02:00
parent 76fce694e1
commit ca04fbc930
2 changed files with 11 additions and 5 deletions

View File

@@ -4,8 +4,6 @@
...
}: let
cfg = config.server.qbittorrent;
url = "https://qbt.${config.server.domain}";
port = 8090;
in {
options.server.qbittorrent = {
enable = lib.mkEnableOption "Enable qBittorrent";
@@ -13,6 +11,11 @@ in {
type = lib.types.str;
default = "qbt.${config.server.domain}";
};
port = lib.mkOption {
type = lib.types.int;
default = 8080;
description = "The port to host qBittorrent on.";
};
homepage.name = lib.mkOption {
type = lib.types.str;
default = "qBittorrent";
@@ -32,10 +35,10 @@ in {
};
config = lib.mkIf cfg.enable {
services.caddy.virtualHosts."${url}" = {
services.caddy.virtualHosts."${cfg.url}" = {
useACMEHost = config.server.domain;
extraConfig = ''
reverse_proxy http://127.0.0.1:${toString port}
reverse_proxy http://127.0.0.1:${toString cfg.port}
'';
};