qbt 4
This commit is contained in:
@@ -28,6 +28,9 @@
|
|||||||
credentialsFile = config.age.secrets.vaultwardenCloudflared.path;
|
credentialsFile = config.age.secrets.vaultwardenCloudflared.path;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
qbittorrent.enable = true;
|
qbittorrent = {
|
||||||
|
enable = true;
|
||||||
|
port = 8090;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.server.qbittorrent;
|
cfg = config.server.qbittorrent;
|
||||||
url = "https://qbt.${config.server.domain}";
|
|
||||||
port = 8090;
|
|
||||||
in {
|
in {
|
||||||
options.server.qbittorrent = {
|
options.server.qbittorrent = {
|
||||||
enable = lib.mkEnableOption "Enable qBittorrent";
|
enable = lib.mkEnableOption "Enable qBittorrent";
|
||||||
@@ -13,6 +11,11 @@ in {
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "qbt.${config.server.domain}";
|
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 {
|
homepage.name = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "qBittorrent";
|
default = "qBittorrent";
|
||||||
@@ -32,10 +35,10 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.caddy.virtualHosts."${url}" = {
|
services.caddy.virtualHosts."${cfg.url}" = {
|
||||||
useACMEHost = config.server.domain;
|
useACMEHost = config.server.domain;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
reverse_proxy http://127.0.0.1:${toString port}
|
reverse_proxy http://127.0.0.1:${toString cfg.port}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user