From ca04fbc93034d463dbc3fa7f5b747b04d59da423 Mon Sep 17 00:00:00 2001 From: cnst Date: Sun, 20 Jul 2025 19:14:49 +0200 Subject: [PATCH] qbt 4 --- hosts/sobotka/server.nix | 5 ++++- modules/server/qbittorrent/default.nix | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hosts/sobotka/server.nix b/hosts/sobotka/server.nix index 83e69125..0e46c959 100644 --- a/hosts/sobotka/server.nix +++ b/hosts/sobotka/server.nix @@ -28,6 +28,9 @@ credentialsFile = config.age.secrets.vaultwardenCloudflared.path; }; }; - qbittorrent.enable = true; + qbittorrent = { + enable = true; + port = 8090; + }; }; } diff --git a/modules/server/qbittorrent/default.nix b/modules/server/qbittorrent/default.nix index 75753217..3d33b48d 100644 --- a/modules/server/qbittorrent/default.nix +++ b/modules/server/qbittorrent/default.nix @@ -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} ''; };