feat(arr): Add exposePorts option
This commit is contained in:
parent
5f027ca12a
commit
74e4e8dcd6
1 changed files with 58 additions and 22 deletions
|
|
@ -14,12 +14,53 @@ let
|
|||
in {
|
||||
options.homelab.apps.arr = {
|
||||
enable = lib.mkEnableOption "Arr Stack using Docker";
|
||||
exposePorts = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Expose all app ports";
|
||||
# Only expose ports by default if Traefik is not in use.
|
||||
default = ! config.homelab.apps.traefik.enable;
|
||||
};
|
||||
|
||||
bazarr.enable = lib.mkEnableOption "Bazarr using Docker";
|
||||
prowlarr.enable = lib.mkEnableOption "Prowlarr using Docker";
|
||||
qbittorrent.enable = lib.mkEnableOption "qBittorrent using Docker";
|
||||
radarr.enable = lib.mkEnableOption "Radarr using Docker";
|
||||
sonarr.enable = lib.mkEnableOption "Sonarr using Docker";
|
||||
bazarr = {
|
||||
enable = lib.mkEnableOption "Bazarr using Docker";
|
||||
exposePorts = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Expose Bazarr port";
|
||||
default = cfg.exposePorts;
|
||||
};
|
||||
};
|
||||
prowlarr = {
|
||||
enable = lib.mkEnableOption "Prowlarr using Docker";
|
||||
exposePorts = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Expose Prowlarr port";
|
||||
default = cfg.exposePorts;
|
||||
};
|
||||
};
|
||||
qbittorrent = {
|
||||
enable = lib.mkEnableOption "qBittorrent using Docker";
|
||||
exposePorts = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Expose qBittorrent port";
|
||||
default = cfg.exposePorts;
|
||||
};
|
||||
};
|
||||
radarr = {
|
||||
enable = lib.mkEnableOption "Radarr using Docker";
|
||||
exposePorts = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Expose Radarr port";
|
||||
default = cfg.exposePorts;
|
||||
};
|
||||
};
|
||||
sonarr = {
|
||||
enable = lib.mkEnableOption "Sonarr using Docker";
|
||||
exposePorts = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Expose Sonarr port";
|
||||
default = cfg.exposePorts;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
@ -204,10 +245,9 @@ in {
|
|||
hostname = "bazarr";
|
||||
image = "ghcr.io/hotio/bazarr:release-1.4.4";
|
||||
autoStart = true;
|
||||
ports = [
|
||||
# Open ports if you don't use Traefik
|
||||
# "${toString port}:${toString port}/tcp"
|
||||
# "${toString port}:${toString port}/udp"
|
||||
ports = lib.mkIf cfg.bazarr.exposePorts [
|
||||
"${toString port}:${toString port}/tcp"
|
||||
"${toString port}:${toString port}/udp"
|
||||
];
|
||||
extraOptions = [
|
||||
"--network=${networkName}"
|
||||
|
|
@ -241,9 +281,8 @@ in {
|
|||
hostname = "prowlarr";
|
||||
image = "ghcr.io/hotio/prowlarr:release-1.23.1.4708";
|
||||
autoStart = true;
|
||||
ports = [
|
||||
# Open ports if you don't use Traefik
|
||||
# "${toString port}:${toString port}/tcp"
|
||||
ports = lib.mkIf cfg.prowlarr.exposePorts [
|
||||
"${toString port}:${toString port}/tcp"
|
||||
];
|
||||
extraOptions = [
|
||||
"--network=${networkName}"
|
||||
|
|
@ -273,10 +312,9 @@ in {
|
|||
hostname = "qbittorrent";
|
||||
image = "ghcr.io/hotio/qbittorrent:release-4.6.7";
|
||||
autoStart = true;
|
||||
ports = [
|
||||
# Open ports if you don't use Traefik
|
||||
# "${toString port}:${toString port}/tcp"
|
||||
# "${toString port}:${toString port}/udp"
|
||||
ports = lib.mkIf cfg.qbittorrent.exposePorts [
|
||||
"${toString port}:${toString port}/tcp"
|
||||
"${toString port}:${toString port}/udp"
|
||||
];
|
||||
extraOptions = [
|
||||
"--network=${networkName}"
|
||||
|
|
@ -307,9 +345,8 @@ in {
|
|||
hostname = "radarr";
|
||||
image = "ghcr.io/hotio/radarr:release-5.9.1.9070";
|
||||
autoStart = true;
|
||||
ports = [
|
||||
# Open ports if you don't use Traefik
|
||||
# "${toString port}:${toString port}/tcp"
|
||||
ports = lib.mkIf cfg.radarr.exposePorts [
|
||||
"${toString port}:${toString port}/tcp"
|
||||
];
|
||||
extraOptions = [
|
||||
"--network=${networkName}"
|
||||
|
|
@ -342,9 +379,8 @@ in {
|
|||
hostname = "sonarr";
|
||||
image = "ghcr.io/hotio/sonarr:release-4.0.9.2244";
|
||||
autoStart = true;
|
||||
ports = [
|
||||
# Open ports if you don't use Traefik
|
||||
# "${toString port}:${toString port}/tcp"
|
||||
ports = lib.mkIf cfg.sonarr.exposePorts [
|
||||
"${toString port}:${toString port}/tcp"
|
||||
];
|
||||
extraOptions = [
|
||||
"--network=${networkName}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue