Updates and fixes
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
configuredMpv = config.programs.mpv.finalPackage;
|
||||
shimWatchdog = pkgs.custom.jellyfin-mpv-shim-watchdog;
|
||||
in{
|
||||
|
||||
config = lib.mkIf (config.syscfg.make.gui) {
|
||||
@@ -81,5 +82,37 @@ in{
|
||||
};
|
||||
|
||||
programs.yt-dlp.enable = true;
|
||||
|
||||
# The upstream jellyfin-mpv-shim service has no Restart and no network
|
||||
# ordering: it happily starts while offline (silently dead) and never
|
||||
# recovers a connection dropped by a network blip. Gate its start on the
|
||||
# network being up, and let a watchdog notice the "up but not connected"
|
||||
# state that systemd can't see. See pkgs.custom.jellyfin-mpv-shim-watchdog.
|
||||
systemd.user.services.jellyfin-mpv-shim.Service = {
|
||||
ExecStartPre = "${shimWatchdog}/bin/jellyfin-mpv-shim-watchdog wait-online";
|
||||
TimeoutStartSec = "infinity"; # stay in start-pre until the network is back
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
|
||||
systemd.user.services.jellyfin-mpv-shim-watchdog = {
|
||||
Unit = {
|
||||
Description = "Restart jellyfin-mpv-shim when it is up but not connected";
|
||||
After = [ "jellyfin-mpv-shim.service" ];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${shimWatchdog}/bin/jellyfin-mpv-shim-watchdog check";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.jellyfin-mpv-shim-watchdog = {
|
||||
Unit.Description = "Periodic health check for jellyfin-mpv-shim";
|
||||
Timer = {
|
||||
OnActiveSec = "60s";
|
||||
OnUnitActiveSec = "60s";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user