jellyfin-qbittorrent-monitor: take into account soulseek
All checks were successful
Build and Deploy / mreow (push) Successful in 2m3s
Build and Deploy / yarn (push) Successful in 1m3s
Build and Deploy / muffin (push) Successful in 1m15s

This commit is contained in:
2026-05-15 02:42:13 -04:00
parent 9662745d6e
commit 293d85b0b5
7 changed files with 273 additions and 6 deletions

View File

@@ -77,14 +77,21 @@ lib.mkIf config.services.jellyfin.enable {
"jellyfin.service"
"qbittorrent.service"
"jellyfin-webhook-configure.service"
];
wants = [ "jellyfin-webhook-configure.service" ];
]
++ lib.optional config.services.slskd.enable "slskd.service";
wants = [
"jellyfin-webhook-configure.service"
]
++ lib.optional config.services.slskd.enable "slskd.service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
ExecStart = pkgs.writeShellScript "jellyfin-monitor-start" ''
export JELLYFIN_API_KEY=$(cat $CREDENTIALS_DIRECTORY/jellyfin-api-key)
${lib.optionalString config.services.slskd.enable ''
export SLSKD_API_KEY=$(cat $CREDENTIALS_DIRECTORY/slskd-api-key)
''}
exec ${
pkgs.python3.withPackages (ps: with ps; [ requests ])
}/bin/python ${./jellyfin-qbittorrent-monitor.py}
@@ -106,7 +113,10 @@ lib.mkIf config.services.jellyfin.enable {
RemoveIPC = true;
# Load credentials from agenix secrets
LoadCredential = "jellyfin-api-key:${config.age.secrets.jellyfin-api-key.path}";
LoadCredential = [
"jellyfin-api-key:${config.age.secrets.jellyfin-api-key.path}"
]
++ lib.optional config.services.slskd.enable "slskd-api-key:${config.age.secrets.slskd-api-key.path}";
};
environment = {
@@ -122,6 +132,9 @@ lib.mkIf config.services.jellyfin.enable {
# Webhook receiver: Jellyfin Webhook plugin POSTs events here to throttle immediately.
WEBHOOK_BIND = "127.0.0.1";
WEBHOOK_PORT = toString webhookPort;
}
// lib.optionalAttrs config.services.slskd.enable {
SLSKD_URL = "http://127.0.0.1:${builtins.toString service_configs.ports.private.soulseek_web.port}";
};
};
}