Refactor
This commit is contained in:
@@ -30,9 +30,10 @@ let
|
||||
in
|
||||
assert containerCfg.subpath == null || throw "Error: Servarr does not support subpath.";
|
||||
{
|
||||
sops = true;
|
||||
requires.secrets = [ name ];
|
||||
# db = [ "prowlarr" "sonarr" "radarr" ]; -> one db for each
|
||||
|
||||
runtime = {
|
||||
paths = [
|
||||
{ path = "${serverCfg.dataPath}/media/"; mode = "0755"; }
|
||||
{ path = "${serverCfg.configPath}/servarr/prowlarr"; mode = "0755"; }
|
||||
@@ -44,6 +45,8 @@ in
|
||||
containers = {
|
||||
}// lib.optionalAttrs (builtins.elem "prowlarr" (containerCfg.extra.modules or defaultModules)) {
|
||||
prowlarr = builder.mkContainer {
|
||||
authentik = true;
|
||||
tmpfs = true;
|
||||
subdomain = containerCfg.subdomain;
|
||||
subpath = "prowlarr";
|
||||
imageStream = images.prowlarr;
|
||||
@@ -58,17 +61,15 @@ in
|
||||
};
|
||||
extraOptions = [
|
||||
"--user=0:0"
|
||||
"--tmpfs=/tmp:rw,noexec,nosuid,size=512m"
|
||||
"--passwd-entry=root:x:0:0:root:/root:/bin/sh"
|
||||
];
|
||||
extraLabels = { } // (if serverCfg.containers ? authentik then {
|
||||
"traefik.http.routers.${containerCfg.subdomain}-prowlarr.middlewares" = "authentik";
|
||||
} else {});
|
||||
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/prowlarr:/config" ];
|
||||
};
|
||||
|
||||
}// lib.optionalAttrs (builtins.elem "radarr" (containerCfg.extra.modules or defaultModules)) {
|
||||
radarr = builder.mkContainer {
|
||||
authentik = true;
|
||||
tmpfs = true;
|
||||
subdomain = containerCfg.subdomain;
|
||||
subpath = "radarr";
|
||||
imageStream = images.radarr;
|
||||
@@ -83,17 +84,15 @@ in
|
||||
};
|
||||
extraOptions = [
|
||||
"--user=0:0"
|
||||
"--tmpfs=/tmp:rw,noexec,nosuid,size=512m"
|
||||
"--passwd-entry=root:x:0:0:root:/root:/bin/sh"
|
||||
];
|
||||
extraLabels = { } // (if serverCfg.containers ? authentik then {
|
||||
"traefik.http.routers.${containerCfg.subdomain}-radarr.middlewares" = "authentik";
|
||||
} else {});
|
||||
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/radarr:/config" ];
|
||||
};
|
||||
|
||||
}// lib.optionalAttrs (builtins.elem "sonarr" (containerCfg.extra.modules or defaultModules)) {
|
||||
sonarr = builder.mkContainer {
|
||||
authentik = true;
|
||||
tmpfs = true;
|
||||
subdomain = containerCfg.subdomain;
|
||||
subpath = "sonarr";
|
||||
imageStream = images.sonarr;
|
||||
@@ -108,17 +107,15 @@ in
|
||||
};
|
||||
extraOptions = [
|
||||
"--user=0:0"
|
||||
"--tmpfs=/tmp:rw,noexec,nosuid,size=512m"
|
||||
"--passwd-entry=root:x:0:0:root:/root:/bin/sh"
|
||||
];
|
||||
extraLabels = { } // (if serverCfg.containers ? authentik then {
|
||||
"traefik.http.routers.${containerCfg.subdomain}-sonarr.middlewares" = "authentik";
|
||||
} else {});
|
||||
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/sonarr:/config" ];
|
||||
};
|
||||
|
||||
}// lib.optionalAttrs (builtins.elem "lidarr" (containerCfg.extra.modules or defaultModules)) {
|
||||
lidarr = builder.mkContainer {
|
||||
authentik = true;
|
||||
tmpfs = true;
|
||||
subdomain = containerCfg.subdomain;
|
||||
subpath = "lidarr";
|
||||
imageStream = images.lidarr;
|
||||
@@ -133,12 +130,8 @@ in
|
||||
};
|
||||
extraOptions = [
|
||||
"--user=0:0"
|
||||
"--tmpfs=/tmp:rw,noexec,nosuid,size=512m"
|
||||
"--passwd-entry=root:x:0:0:root:/root:/bin/sh"
|
||||
];
|
||||
extraLabels = { } // (if serverCfg.containers ? authentik then {
|
||||
"traefik.http.routers.${containerCfg.subdomain}-lidarr.middlewares" = "authentik";
|
||||
} else {});
|
||||
overrides.volumes = sharedVolumes ++ [ "${serverCfg.configPath}/servarr/lidarr:/config" ];
|
||||
};
|
||||
|
||||
@@ -526,4 +519,5 @@ in
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user