Add pod name automagically

This commit is contained in:
pazpi 2024-08-28 21:04:39 +02:00
parent 3bdf838524
commit d3eb6a7485

View file

@ -16,7 +16,6 @@ let
enable = true;
image = "linuxserver/jackett";
autoStart = true;
extraOptions = [ "--pod=download" ];
volumes = [
"jackett_config:/config"
"jackett_data:/data"
@ -27,7 +26,6 @@ let
enable = true;
image = "linuxserver/radarr";
autoStart = true;
extraOptions = [ "--pod=download" ];
volumes = [
"radarr_config:/config"
"radarr_data:/data"
@ -38,7 +36,6 @@ let
enable = false;
image = "linuxserver/sabnzbd";
autoStart = true;
extraOptions = [ "--pod=download" ];
volumes = [
"sabnzbd_config:/config"
"sabnzbd_data:/data"
@ -49,7 +46,6 @@ let
enable = true;
image = "linuxserver/sonarr";
autoStart = true;
extraOptions = [ "--pod=download" ];
volumes = [
"sonarr_config:/config"
"sonarr_data:/data"
@ -60,16 +56,22 @@ let
enable = true;
image = "linuxserver/prowlarr";
autoStart = true;
# extraOptions = [ "--pod=download" ];
volumes = [ "prowlarr_config:/config" ];
};
};
enabledContainers =
containers:
lib.mapAttrs (name: container: lib.removeAttrs container [ "enable" ]) (
lib.filterAttrs (name: container: container.enable) containers
);
# Pod Definition
download = {
name = "download";
ports = [
"7878:7878" # : Radarr
# "8080:8080" # : Sabnzbd
"8989:8989" # : Sonarr
"9117:9117" # : Jackett
"9696:9696" # : Prowlarr
];
containers = containersDefinition;
};
in
{
@ -102,20 +104,14 @@ in
config = lib.mkIf cfg.enable {
my.virtualisation.podmanPods = {
download = {
name = "download";
ports = [
"7878:7878" # : Radarr
# "8080:8080" # : Sabnzbd
"8989:8989" # : Sonarr
"9117:9117" # : Jackett
"9696:9696" # : Prowlarr
];
containers = enabledContainers containers;
};
inherit download;
};
virtualisation.oci-containers.containers = enabledContainers containers;
virtualisation.oci-containers.containers =
let
pod = config.helpers.processContainers download;
in
pod.containers;
services.caddy = lib.mkIf cfg.proxy.enable {
enable = true;