* feat: adguard tweaks * hacking docs * chore: update zfs scrib int * hack * feat: warning for adguard schema mismatch --------- Co-authored-by: Truxnell <9149206+truxnell@users.noreply.github.com>
95 lines
2.7 KiB
Nix
95 lines
2.7 KiB
Nix
{ lib
|
|
, config
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
with lib;
|
|
let
|
|
app = "prowlarr";
|
|
image = "ghcr.io/onedr0p/prowlarr:1.15.0.4361@sha256:cf646c64fdb90f3acddb5e2ec6ffad064392ad1aaf9da7875b8a7a962263f5fc";
|
|
user = "568"; #string
|
|
group = "568"; #string
|
|
port = 9696; #int
|
|
cfg = config.mySystem.services.${app};
|
|
appFolder = "containers/${app}";
|
|
persistentFolder = "${config.mySystem.persistentFolder}/${appFolder}";
|
|
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"
|
|
"/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}";
|
|
|
|
description = "Content locator";
|
|
container = "${app}";
|
|
widget = {
|
|
type = "${app}";
|
|
url = "https://${app}.${config.mySystem.domain}";
|
|
key = "{{HOMEPAGE_VAR_PROWLARR__API_KEY}}";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
|
|
mySystem.services.gatus.monitors = [{
|
|
|
|
name = app;
|
|
group = "media";
|
|
url = "https://${app}.${config.mySystem.domain}";
|
|
interval = "1m";
|
|
conditions = [ "[CONNECTED] == true" "[STATUS] == 200" "[RESPONSE_TIME] < 50" ];
|
|
}];
|
|
|
|
services.restic.backups = config.lib.mySystem.mkRestic
|
|
{
|
|
inherit app user;
|
|
excludePaths = [ "Backups" ];
|
|
paths = [ appFolder ];
|
|
inherit appFolder;
|
|
};
|
|
|
|
};
|
|
}
|