* flesh out impermanence * glances * hack * hacking in plex and tautulli * hack * hacking * Auto lint/format --------- Co-authored-by: Truxnell <9149206+truxnell@users.noreply.github.com> Co-authored-by: truxnell <truxnell@users.noreply.github.com>
87 lines
2.6 KiB
Nix
87 lines
2.6 KiB
Nix
{ lib
|
|
, config
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
with lib;
|
|
let
|
|
app = "prowlarr";
|
|
image = "ghcr.io/onedr0p/prowlarr:1.15.0.4361@sha256:32a758a73d12a6a6d76cfa029784fa963a4f5b0ff6c34e985498ea099674560d";
|
|
user = "568"; #string
|
|
group = "568"; #string
|
|
port = 9696; #int
|
|
cfg = config.mySystem.services.${app};
|
|
persistentFolder = "${config.mySystem.persistentFolder}/${app}";
|
|
in
|
|
{
|
|
options.mySystem.services.${app} =
|
|
{
|
|
enable = mkEnableOption "${app}";
|
|
addToHomepage = mkEnableOption "Add ${app} to homepage" // { default = true; };
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
# ensure folder exist and has correct owner/group
|
|
systemd.tmpfiles.rules = [
|
|
"d ${persistentFolder} 0755 ${user} ${group} -" #The - disables automatic cleanup, so the file wont be removed after a period
|
|
];
|
|
|
|
sops.secrets."services/${app}/env" = {
|
|
|
|
# configure secret for forwarding rules
|
|
sopsFile = ./secrets.sops.yaml;
|
|
owner = config.users.users.kah.name;
|
|
inherit (config.users.users.kah) group;
|
|
restartUnits = [ "podman-${app}.service" ];
|
|
};
|
|
|
|
virtualisation.oci-containers.containers.${app} = {
|
|
image = "${image}";
|
|
user = "${user}:${group}";
|
|
environment = {
|
|
PUSHOVER_DEBUG = "false";
|
|
PUSHOVER_APP_URL = "${app}.${config.mySystem.domain}";
|
|
PROWLARR__INSTANCE_NAME = "Prowlarr";
|
|
PROWLARR__APPLICATION_URL = "https://${app}.${config.mySystem.domain}";
|
|
PROWLARR__LOG_LEVEL = "info";
|
|
};
|
|
environmentFiles = [ config.sops.secrets."services/${app}/env".path ];
|
|
volumes = [
|
|
"${persistentFolder}:/config:rw"
|
|
"${persistentFolder}:/config:rw"
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
];
|
|
labels = config.lib.mySystem.mkTraefikLabels {
|
|
name = app;
|
|
inherit port;
|
|
};
|
|
};
|
|
|
|
mySystem.services.homepage.media-services = mkIf cfg.addToHomepage [
|
|
{
|
|
Prowlarr = {
|
|
icon = "${app}.png";
|
|
href = "https://${app}.${config.mySystem.domain}";
|
|
ping = "https://${app}.${config.mySystem.domain}";
|
|
description = "Content locator";
|
|
container = "${app}";
|
|
widget = {
|
|
type = "${app}";
|
|
url = "https://${app}.${config.mySystem.domain}";
|
|
key = "{{HOMEPAGE_VAR_PROWLARR__API_KEY}}";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
|
|
mySystem.services.gatus.monitors = mkIf config.mySystem.services.gatus.enable [{
|
|
|
|
name = app;
|
|
group = "media";
|
|
url = "https://${app}.${config.mySystem.domain}";
|
|
interval = "30s";
|
|
conditions = [ "[CONNECTED] == true" "[STATUS] == 200" "[RESPONSE_TIME] < 50" ];
|
|
}];
|
|
|
|
};
|
|
}
|