jellyfin-qbittorrent-monitor: take into account soulseek
This commit is contained in:
@@ -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}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user